Chart ToolTip and DateTime

Hi,
I have a problem with chart on windows essential studio 5.2.0.25.
The chart is using DateTime on the primary X axis to represent market data, I am using tooltip in a candle chart to represent for each point:
- On the y axis: High, Low, Open, Close
- On the x axis: DateTime
I tried to used the PointsToToolTip property of the chart series:
this._cs.PointsToolTipFormat =
"{3} - O: {" +((int)YValueIndex.Open + 4).ToString()
+ "}, C: {" + ((int)YValueIndex.Close + 4).ToString()
+ "}, H: {" + ((int)YValueIndex.High + 4).ToString()
+ "}, L: {" + ((int)YValueIndex.Low + 4).ToString() + "}";
And It work fine except for the X axis (DateTime) that return me an integer instead of a date, for example with the format above:
40078 – O: 52.47, C: 45.8, H: 54.4, L: 45.55
(See the 40078 instead of the date)
I tried as well to set the Tooltip directly to the chartSeries.Styles property when I populate the points:
toolTipText = quote.DateTime.ToShortDateString()
+ " - O: " + quote.Open.ToString()
+ ", C: " + quote.Close.ToString()
+ ", H: " + quote.High.ToString()
+ ", L: " + quote.Low.ToString();
this._cs.Points.Add(point);
this._cs.Styles[this._cs.Points.Count - 1].ToolTip = toolTipText;
And tried the same using the ChartPrepareStyleInfoHandler event handler of the chart series with no success; in both cases I only have the first Y data (HighPrice or {4}) which is the default value for the ToolTip.

Could you help me?

Thanks in advance,
-Benoit

2 Replies

BM Benoit Marsot October 23, 2009 06:20 PM UTC

Ok I finally figure out that you need to set the chart series property PointsToolTipFormat to "{2}" for the PrepareStyle callback method to be able to set the tooltip.

Thanks,
Benoit


VV Venkata Vijayaraj B Syncfusion Team October 26, 2009 10:05 AM UTC

Hi Benoit,

We are glad to hear that your problem has been resolved.

Please feel free to contact us if you have any other concerns.

Regards,
Venkat.

Loader.
Up arrow icon