|
Tooltip and hotspot gives wrong x,y in activeX |
Posted by Soren Munk on Mar-02-2012 18:15 |
|
Dear sir,
We are currently testing several chart solution, and do by far prefer your.
However, during tests we have discovered a bug in the tooltip/hotspot info that could make ChartDirector useless for our purposes.
Its as simple as said in the subject line, on some XYChart's the tooltip info given is not from the point the mouse is over.
I have created a small demo-project and attached, together with source code and a screen shot.
I sincerely hope there is a solution or a work-around since we find your tool superior on the marked with regards to ease of use and features.
Thank you,
Soren
|
Re: Tooltip and hotspot gives wrong x,y in activeX |
Posted by Peter Kwan on Mar-03-2012 01:15 |
|
Hi Soren,
The behaviour you see is because your chart is a line chart, so ChartDirector will generate the image map for the line segments, not just the symbols. Although your code have set the line width to 0, so the line is invisible, ChartDirector will still generate the image map for the invisible line. (This method is in fact commonly used to create invisible hot spots in ChartDirector.) If you set the line width to 1, you can see the line segments. The point in your screen shot (at x = 67.82) happens to overlap with a line segment to the point at (x = 68.15). So when the mouse is over the data point, it is also over the line segment, and it picks up the tooltip for the line segment (68.15, 6700).
For your case, to achieve what you need, you may consider the following methods:
(a) If you just need the symbols, please use a scatter layer. To do this, please change the following code:
Dim layer As LineLayer
Set layer = c.addLineLayer(Y, &HFF0000, "Data")
layer.setXData X
layer.setLineWidth 0
layer.getDataSet(0).setDataSymbol cd.CircleSymbol, 9, &HFF0000, &H0, 0
into:
Dim layer As ScatterLayer
Set layer = c.addScatterLayer(X, Y, "Data", cd.CircleSymbol, 9, &HFF0000, &H0)
or
(b) If you prefer to use the line layer, please add the following line to disable the image map for the line segments. In this way, only the data symbols are clickable:
Call layer.setImageMapWidth(0)
Hope this can help.
Regards
Peter Kwan
|
Re: Tooltip and hotspot gives wrong x,y in activeX |
Posted by Soren Munk on Mar-05-2012 00:31 |
|
Thanks for your quick response, that makes a lot of sense and works perfectly!
Best regards, Soren. |
|