Is it possible to get the Values from Crosshair depending on X- and Y-Axisand Show them in tooltip?
I'm using UltraDataChart.
Hi,
Thank you for posting in our forums.
I will need more details about your scenario. Do you want just to display the X and Y coordinates in the chart? That could be implemented by handling MouseMove event of the chart and using a graphics object in order to draw the coordinates given by the Location property of the MouseMove event arguments. Or you want, for example in a scatter chart, to display what value would be in the crosshair point?
Please clarify your requirement and I will try to implement it in a sample for you.
I am looking forward to hearing from you.
Thanks for your Reply. I don't want only the X/Y-coordinates. I want to Display, e.g. in a tooltip, the currently value of the X-axis (is a dateTime-value) and all values at this Point of all inserted series (all int on numeric y-axis). Is that possible?
Thank you for the clarification.
What you could do in order to achieve this functionality, by using a timer’s tick event and subscribing to the mouse move event of the chart. In both event get the mouse coordinates and convert them to world coordinates (they range from 0, 0 to 1, 1). Then you can calculate what the value is using the axes’ ActualMinimumValue and ActualMaximumValue and draw them on the chart using a graphics object.
I have attached a sample which demonstrates this approach.
Please let me know if you have any additional questions.
Thanks for your example, but i now get the coordinates of crosshair in ultradatachart, not the depending values of the series.
Date is shown and the value of my Scala depending of crosshair Position. Y-Value is always the same as Long as i move crosshair only horizontal. Even if the seriesline value is changing.
Beacuse there are 3 yAxis in my Chart with 10 series i Need the value of each series depending on the current xAxis.
I search for the same functionality as like in WPF or Silverlight DataChart.
Thank you for the reply.
It seems that there is a way to achieve similar functionality as in WPF or Silverlight. You need to handle the TooltipContentUpdating of your series. In it return a control like a Label and set the label text based on the value of the item that you are hovering.
I have modified my sample in order to demonstrate this approach.
A Little Problem for now. The tooltipUpdate only happens while crosshair is on lineseries or in areaseries. It is not functional if the crosshair is above all series and even on lineseries it is very difficult to get the line.
If I am understanding you correctly, you want to show this tooltip even if the mouse isn’t over any series. If that is the case, you can achieve this by adding a transparent series that fills all the available space behind your actual series. If the TooltipContentUpdating event is fired for this series, it would mean that the mouse is over the empty space. Than you can show the tooltip, using similar approach as in my previous sample.