Hi
I've added two vertical demarcation lines to a line chart with the FillSceneGraph event. I have two problems.
The first is using CInt(axisX.Map(target)). The values on the xAxis are integers that represent dates and 15 minutes time periods i.e. 2010100400. When I try to get a location on the x-axis to draw the line I get an arithmetic overflow error. How do I correctly find the x-axis location ofr the line?
The second problem is that the lines do not scroll when the graph is scrolled. As the chart scrolls, the lines are fixed in their x-axis position instead of scrolling to the correct x-axis location. How do I get the lines to sync with the scroll window?
Any help greatly appreciated.
Regards
James O'Doherty
MapMinimum and MapMaximum return screen coordinates and the lowes and the highest points on the axis. These values only depend on the physical size of the axis line on the screen and have no relation to your data. To get a meaningful value, use something likemyXValue = CLng(axisX.Map(2009031600)). This will take a value somewhere within your range and turn it into a screen x coordinate.
Hi Max
Thanks for the reply however I'm not clear how the axis mapping works because in my example the x-axis has coordinates from 2009031500 to 2009031800 and when I break on FillSceneGraph event and I look at the value of MapMinimum and MapMaximum I get value of 37 to 554 respectively.
I am trying to set a line at 2009031625 so using
How do the values from the axis mapping function translate to the values returned by MapMinimum and MapMaximum?
Let me know.
Cheers
The overflow happens because you're trying to convert a Long number to an Int. Try converting to Long instead, and you won't see this problem.
With regards to scrolling, if you added your lines at some absolute screen coordinates, scrolling won't have any effect. If you used axis mapping for your lines, you should be able to see them move, because mapping results change when you scroll.