Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
UltraChart cross hair and the retrieval of all vertical values in the chart
posted

Hi,

following situation: I have a chart that contains multiple chart components. The x-Axis is time based and has a well known range. The values are not previously known and neither is the type of contained chart. So some are histogramcharts, some are linecharts, ..

At this point I wanted to retrieve the values that appear on the vertical axis of the current mouse position (i.e. chart 1 has at time X this value, chart 2 has at time X that value, ...). If there would be no value at this exact position, I could at all times linearily interpolate it with the two containing values to the left and to the right.

Now what I tried to accomplish it was:

* activate the cross hair
* attach to the UltraChart.MouseMove event
* calculate back the X position relative to the UltraChart component to the time based on the time range displayed and the width of the UltraChart
* last but not least iterate over the chart components (stored in the UltraChart.Series property) and retrieve the value at the selected time

And here the problems:

* cross hair works fine
* event is triggered, fine
* the width of the UltraChart component does not match the UltraChart.Width property and there is no UltraChart.RenderWidth property; is there another property? The chart property tells me it is aroud 1600px, but truly is around 2200px if I move the mouse on it and output the position. Or is there some kind of scaling property that I need to include in my calculation?
* under the assumption the calculation at point 3 worked and produced a valid result, would I really have to search linearly the two values I want using the UltraChart.Series property?

glad and happy for any kind of help,
vazlav