sheng Posted August 3, 2009 Report Share Posted August 3, 2009 I'm using financial extension. The tooltip shows the open, high, low, close value but no date is shown. How do I add the date to the tooltip? I tried ToolTipFormat, but I can't get open, high, low, close value using Format. Please help. Thanks Quote Link to comment Share on other sites More sharing options...
CarlosAC Posted October 20, 2009 Report Share Posted October 20, 2009 Hi sheng This is an unsupported feature in Chart FX, you cannot get directly the OHLC values in order to set them in the Tooltip. But, from spoken with a Chart FX developer, he was able to come up with a work around for you. It involves changing the Text property of every point in the chart and set the tooltip to %L right before the chart gets painted (I was only able to make it work at the PrePaint event). private void chart1_PrePaint(object sender, ChartFX.WinForms.CustomPaintEventArgs e) { if (string.IsNullOrEmpty(chart1.ToolTipFormat)) { for (int i = 0; i < chart1.Data.Points; i++) { chart1.Points.Text = DateTime.FromOADate(chart1.Data.X).ToString().Split(' ')[0] + "\r\n" + "Open: " + chart1.Data[0, i].ToString() + "\r\n" + "High: " + chart1.Data[1, i].ToString() + "\r\n" + "Low: " + chart1.Data[2, i].ToString() + "\r\n" + "Close: " + chart1.Data[3, i].ToString(); } chart1.ToolTipFormat = "%L"; } } I must remind you that this is a workaround over an unsupported feature. Carlos Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.