|
getHTMLImageMap for Multiple layers problem |
Posted by bagyo on May-28-2009 10:08 |
|
In linelayers, how can I display in getHTMLImageMap tool tip the individual data label of different layers?
the scenario is I have 4 linelayers in one graph with different no of data.
I add extrafield which is 2-dimensional array.
my problem is when I do the mouseover in one of the data, the tooltip display only the first data of linelayer other layer is the same, if i put 2 extra field in tooltip like ( {field0} {field1} it display the 2 data label and so on.
what I want is if I do the mouseover the datalabel will display for each individual linelayer. please help me for this problem.
here's my code:
c.xAxis().setLabels(tmpProjSheetNo(i))
c.xAxis().setLabels(tmpProjSheetNo(i))
For i = 0 To UBound(ProductList)
ReDim Preserve lHEAD_1(i)
lHEAD_1(i) = c.addLineLayer(tmpProjList(i), LayerColor(i), ProductList(i))
c.addExtraField(tmpProjSheetNo(i))
lHEAD_1(i).setLineWidth(1)
c.yAxis().setLinearScale(0, 15, 3)
lHEAD_1(i).getDataSet(0).setDataSymbol(Chart.DiamondSymbol, 4, &HCC0000,
&HCC0000)
Next
viewer.Image = c.makeWebImage(ChartDirector.Chart.JPG)
viewer.ImageMap = c.getHTMLImageMap("", "", _
"title='ID No.: {field0} | Time(Mins.): {value}'")
Thanks alot |
Re: getHTMLImageMap for Multiple layers problem |
Posted by Peter Kwan on May-29-2009 02:20 |
|
Hi bagyo,
You may add an extra field to tell ChartDirector the tool tips you want, then ask ChartDirector to use that extra field as the tool tips. For example:
Dim i As Integer
Dim j As Integer
'The tooltips you want to use
Dim myToolTips(UBound(tmpProjList(0))) As String
For i = 0 To Ubound(tmpProjList(0))
myToolTips(i) = " "
For j = 0 To Ubound(ProductList)
myToolTips(i) = myToolTips(i) & "[" & ProductList(j) & "=" & tmpProjList(j)(i) & "] "
Next
Next
'Now add a line layer for the lines, adding the tooltips array above as an extra field
Dim layer As LineLayer = c.addLineLayer2()
layer.addExtraField(myToolTips)
For i = 0 To UBound(ProductList)
layer.addDataSet(tmpProjList(i), LayerColor(i), ProductList(i)).setDataSymbol(Chart.DiamondSymbol, 4, &HCC0000, &HCC0000)
Next
viewer.Image = c.makeWebImage(ChartDirector.Chart.JPG)
'show the extra field as tooltips
viewer.ImageMap = c.getHTMLImageMap("", "", "title='{field0}'")
Hope this can help.
Regards
Peter Kwan |
|