Avoid the DateTimeAxis.ToDouble() result in the tooltip

Apr 27, 2013 at 11:59 PM
Hi, using financial series (as Y values) and date time (as X values) I need to use the DateTimeAxis.ToDouble to convert the date time value in the HighLowItem costructor.

This works fine but the tooltip on the chart show the result of the DateTimeAxis.ToDouble method.

There's a way in order to show the date in tooltip using financial series?

Best regards

MaxAmbrogi
Coordinator
Apr 29, 2013 at 12:18 PM
this sounds like a bug in the HighLowSeries.GetNearestPoint method. Added to https://oxyplot.codeplex.com/workitem/10044
It is possible the code should be refactored to let the axes do the formatting of the x and y values!
Apr 29, 2013 at 5:27 PM
objo wrote:
this sounds like a bug in the HighLowSeries.GetNearestPoint method. Added to https://oxyplot.codeplex.com/workitem/10044
It is possible the code should be refactored to let the axes do the formatting of the x and y values!
Seeing the source code thru browser, probably two actions are required:
  1. new constructor and properties in HighLowItem.cs named xAsStringForTooltip (the date as desired string)
  2. refactor the HighLowSeries.GetNearestPoint method in order to manage the presence the above xAsStringForTooltip property
    I'm right and can I support you?
    Best regards
    MaxAmbrogi
Coordinator
May 6, 2013 at 9:23 AM
I have checked in a change that converts the x values to DateTime values before formatting the text of the tooltip. Use the TrackerFormatString in the series to control the format of the date (see examples). My comment about letting the axes do the formatting was not a good idea - the formatting of the dates on the axes may be different.
May 29, 2013 at 2:27 PM
Perfect Objo, many thanks for this!
Best regards
MaxAmbrogi