ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Displaying info in scatter layer
Posted by icm63 on Jan-03-2012 06:36

I am plotting data points on a chart

my vb.net code

I have this array for my data points :VolumeWavePivPoints

The array is like this

X,Y
0,Chart.noValue
1,Chart.noValue
2,Chart.noValue
3,100.50
4,Chart.noValue
5,110.5

I have another array which is information I wish to display in the title='' imagemap. Called this : VolumeWavePivChange

Which is :
0,Chart.noValue
1,Chart.noValue
2,Chart.noValue
3,0
4,Chart.noValue
5,10.0%

QUESITON : How can I show the percentage change between two data points within a scatterlayer array? Which is showing the data in the array 'VolumeWavePivChange' in the titile ='' part of the code ??

Dim SymPath1 As String = Replace(AppDomain.CurrentDomain.BaseDirectory, "\\", "/") & "images1/VolumeWavePivot.png"
Dim myLayer1 As ScatterLayer
myLayer1 = c.addScatterLayer(Nothing, VolumeWavePivPoints, "", Chart.SquareSymbol, 20, Chart.Transparent, Chart.Transparent)
myLayer1.getDataSet(0).setDataSymbol2(SymPath1)
myLayer1.moveFront()
myLayer1.setHTMLImageMap("", "", " title='{xLabel|mm/dd/yyyy} Swing Points ${value|2} Change" & VolumeWavePivChange(CInt("'x'")) & "%'")

  Re: Displaying info in scatter layer
Posted by Peter Kwan on Jan-04-2012 00:42
Hi icm63,

Please use:

myLayer1.addExtraField(VolumeWavePivChange);
myLayer1.setHTMLImageMap("", "", " title='{xLabel|mm/dd/yyyy} Swing Points ${value|2} Change {field0}%'")

Hope this can help.

Regards
Peter Kwan

  Re: Displaying info in scatter layer
Posted by icm63 on Jan-04-2012 02:32
Thanks, but no data is coming through on the "Change" part, I mean nothing is showing(like its reading the Chart.NoValue part)!

My array

For i As Integer = 0 To VolumeWavePivPoints.GetUpperBound(0)
Util.zPFile(i & " / " & VolumeWavePivPoints(i) & " / " & VolumeWavePivChange(i))
Next

0104 07:27:48 # 556 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 557 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 558 / 123.51 / 12
0104 07:27:48 # 559 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 560 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 561 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 562 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 563 / 107.43 / -13
0104 07:27:48 # 564 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 565 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 566 / 129.42 / 20.5
0104 07:27:48 # 567 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 568 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 569 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 570 / 116.2 / -10.2
0104 07:27:48 # 571 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 572 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 573 / 1.7E+308 / 1.7E+308
0104 07:27:48 # 574 / 1.7E+308 / 1.7E+308

You see line 570, 566 line up ok for data in array:Price and Change btw points

My code

Dim SymPath1 As String = Replace(AppDomain.CurrentDomain.BaseDirectory, "\\", "/") & "images1/VolumeWavePivot.png"
Dim myLayer1 As ScatterLayer
myLayer1 = c.addScatterLayer(Nothing, VolumeWavePivPoints, "", Chart.SquareSymbol, 20, Chart.Transparent, Chart.Transparent)
myLayer1.getDataSet(0).setDataSymbol2(SymPath1)
myLayer1.moveFront()
myLayer1.addExtraField2(VolumeWavePivChange)
myLayer1.setHTMLImageMap("", "", " title='{xLabel|mm/dd/yyyy} Swing Point ${value|4} Change {field0|1}%'")

Any ideas

  Re: Displaying info in scatter layer
Posted by icm63 on Jan-04-2012 02:39
The result is the same with either addExtraField2 or addExtraField

  Re: Displaying info in scatter layer
Posted by Peter Kwan on Jan-04-2012 03:38
Hi icm63,

Is your chart actually part of a FinanceChart with leading points removed (that is, in FinanceChart.setData, the "extraPoints" parameter is non-zero)?

If this is the case, you would need to remove those points from VolumeWavePivChange before passing it to ChartDirector. It means the length of the VolumeWavePivChange array should equal to the length of the VolumeWavePivPoints array minus the number of extra points.

In other words, the VolumeWavePivChange should match with the plotted data points, which may not be the same as the data array for a FinanceChart.

Regards
Peter Kwan