|
Extra Field is not working |
Posted by Hunter on Jul-19-2012 00:15 |
|
In the following code I'm trying to include field0 in the clickable URL. However what is
being included in the URL (or in the tooltip) is {field0}. What am I doing wrong? Thanks
Sub Drawline(ByVal wvc As WebChartViewer, ByVal Labels() As DateTime, ByVal
TTResponse() As Double, ByVal TTRepair() As Double, IDs() As String, ByVal Title As
String)
Dim c As XYChart = New XYChart(800, 350)
c.setPlotArea(50, 25, 700, 240).setGridColor(&HC0C0C0, &HC0C0C0)
c.addTitle(Title, "Arial Bold", 12)
c.addLegend(50, 300, False, "Arial Bold", 10).setBackground(Chart.Transparent)
c.yAxis().setWidth(3)
c.yAxis().setTitle("Hours")
c.xAxis().setTitle("Close Date", "Arial Bold Italic", 12)
c.xAxis().setWidth(3)
c.xAxis.setLabels(Labels)
c.xAxis().setDateScale(Labels(0), Labels(Labels.Length - 1))
c.xAxis().setMultiFormat(Chart.StartOfMonthFilter(), _
"<*font=Arial Bold*>{value|mmm d}", Chart.StartOfDayFilter(), "-{value|d}")
c.addScatterLayer(Chart.CTime(Labels), TTResponse, "Time To Respond", _
Chart.DiamondSymbol, 9, &HFF)
c.addScatterLayer(Chart.CTime(Labels), TTRepair, "Time To Repair", _
Chart.SquareSymbol, 9, &HAA0000)
Dim layer As SplineLayer = c.addSplineLayer(New
ArrayMath(TTResponse).lowess().result(), &HFF)
layer.setLineWidth(2)
layer.setXData(Chart.CTime(Labels))
layer.addExtraField(IDs)
Dim layer1 As SplineLayer = c.addSplineLayer(New
ArrayMath(TTRepair).lowess().result(), &HAA0000)
layer1.setLineWidth(2)
layer1.setXData(Chart.CTime(Labels))
layer1.addExtraField(IDs)
c.yAxis().setAutoScale(0, 0, 0)
wvc.Image = c.makeWebImage(Chart.PNG)
WebChartViewer1.ImageMap = c.getHTMLImageMap("AddCallTicketNew.aspx",
"ticketid='{field0}'", "title='({dataSetName}, {value|2} hrs) id:{dsdifield0}'")
End Sub |
Re: Extra Field is not working |
Posted by Peter Kwan on Jul-19-2012 03:11 |
|
Hi Hunter,
In your case, the spline layer should have the extra field, while the scatter layer should not have the extra field (as there is no addExtraField for the scatter layer). Because the getHTMLImageMap applies to all the layers, and the scatter layer does not have an extra field, so the image map will leave the extra field as {field0}.
For your case, you may consider the followings:
(a) If you want all the layers to have the same extra field, you may add the extra field to the BaseChart object instead of the layer object. For example:
c.addExtraField(IDs)
In this case, all the layers will have {field0} expanded to the IDs.
(b) If you want the spline layers to have an extra field, but the scatter layer not to have an extra field, this means the scatter layer should be using a different image map configuration. You may use Layer.setHTMLImageMap to configure the scatter layer to use an alternative image map configuration.
(c) The {dsdifield0} should be {dsdiField0}. In your case, because all of your layers only have one data set, so {dsdiField0} is the same as {field0}.
Hope this can help.
Regards
Peter Kwan |
Re: Extra Field is not working |
Posted by Hunter on Jul-25-2012 22:04 |
|
a) did the trick. Thanks! |
|