Jump to content
Software FX Community

Date does not show in tooltip


sheng
 Share

Recommended Posts

  • 2 months later...

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...