|
access x-axis data value for non-hotspot |
Posted by Manoj on Jan-15-2011 00:23 |
|
Hello Peter,
I've create a multi-line chart with 2 y-axiss and dates on the x-axis and all of this is working fine. I have another requirement. As the mouse moves on the chart I need to display the x-axis data value
in a edit box, without clicking any hotspots. So basically, whatever
x-axis data value the mouse is over, regardless of whether that is
a hot-spot or a normal non-clickable area in the chart I need to
access the x-axis data value as the mouse hovers over. I understand
I need to do this in the OnMouseMove() handler, but how exactly
can I extract this data from the ImageMapHandler or some other
way ? I'm using your MFC ChartViewer class. Can you suggest a
solution to access this data in the OnMouseMove() ?
I would greatly appreciate any help.
Thank you.
Best regards.
Manoj. |
Re: access x-axis data value for non-hotspot |
Posted by Peter Kwan on Jan-15-2011 03:27 |
|
Hi Manoj,
I assume you already know the MFC OnMouseMove method provides you with the pixel coordinates of the mouse cursor. What is needed is to translate the pixel coordinates to x-data value.
The ChartDirector API Axis.getMaxValue, Axis.getMinValue and XYChart.getXCoor allows you to obtain the axis scale and its position in pixel coordiantes. You may use these methods to convert the pixel coordinate to data values. See:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1187910016#N1187953452
Hope this can help.
Regards
Peter Kwan |
|