Jump to content
Software FX Community
dolgorae

How to show decimal point in tooltips?

Recommended Posts

Hello.

My chart shows double data type values, but the tooltips show integer type value.

How can I show the orignal double type values to each tooltips?

Thanks.

 

Alex.

Share this post


Link to post
Share on other sites

Hi, 

If you want to show the original double type value (without specifying a fixed number of decimals), you can use the GetTip Event to create a custom tooltip. Take a look at the following sample:private void chart1_GetTip(object sender, GetTipEventArgs e){ if (e.HitType == HitType.Point)  {   e.Text = chart1.Data[0, e.Point].ToString(); }}

Alternatively, you can use the DataFormat property to specify the number of decimals:

chart1.AxisY.DataFormat.Decimals = 2;

Note: Using the DataFormat property will also specify the number of decimals for the pointlabels.

Hope this helps,

Share this post


Link to post
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.

Loading...

×
×
  • Create New...