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
390
Tool tip
posted

Hello,

I am using CategoryXAxis in my real-time chart and as per requirement need plot the data every second.

If there is no data received at each second I am writing data point with double.NaN with current date time,

so that Xaxis label will be updated ever second, the  NaN points are not plotted as expected but I have code that display tool tip.

The tool tip binding picks the NaN points as well. Is there any way to show interpolated point value instead of showing NaN in tool tip.

 

  • 34430
    Offline posted

    Hello Member,

    Thank you for your post.

    Currently there isn't anything built into the XamDataChart that will tell you exactly what an interpolated data point's value is, as the actual underlying value is null, but there are a couple of things you could do to work around this limitation.

    First, it may be useful to know that when the XamDataChart series use interpolation for unknown points, it is of a linear fashion. In other words, if you have 3 points, with values of 5, double.NaN, and 10, it might be logical to be able to assume that the interpolated point falls at the 7.5 mark, or the mark of (5 + 10) / 2. If you wish to show a value for your interpolated points, I would suggest that you follow this type of logic by adding a separate property to your data item to include interpolated points. You can then check the points before and after the interpolated point(s) for the real values and calculate the midpoints for these new "interpolated values." If you were to style your tooltip in such a way that checks if your value path is null, and if it is show the interpolated value instead, then I believe that you could achieve your requirement on this matter.

    I have attached a sample project to demonstrate the above, in which the XamDataChart is updated every second and every other data point will be interpolated.

    Perhaps an alternative option to this would be to avoid the null/interpolated points altogether. For this, I would recommend using an ItemTooltipLayer in the XamDataChart. You can read about the ItemTooltipLayer here: http://help.infragistics.com/Help/Doc/WPF/2013.1/CLR4.0/html/HoverInteractions_ItemTooltipLayer.html. By default, the ItemTooltipLayer will snap to the closest points that actually have values, and will ignore the points without them. I'm not entirely sure if this is an option for you, though, and so you may want to continue with the calculated interpolated value option demonstrated in the attached sample.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamDataChartInterpolatedTooltipCase.zip