Jump to content
Software FX Community

Setting Axis Precision to Zero Decimals and Data Precision to Two Decimals


paul.koanui
 Share

Recommended Posts

Hello,

I have a chart with an Y-Axis which I need to display only whole numbers.  At the same time, however, I want the data point labels to show their value to 2 decimals.  I thought that changing the Decimals property of the LabelsFormat property to zero would solve the problem.  It did for the axis labels but it also rounds my data point labels to the nearest whole number as well.  How can I achieve the type of formatting that I'm looking for?

 

Thanks,

Paul 

Link to comment
Share on other sites

You need to set the Decimals property of the data format and enable the point labels as follows:

chart1.AxisY.LabelsFormat.Decimals = 0;

chart1.AxisY.DataFormat.Decimals = 2;

chart1.AllSeries.PointLabels.Visible =

true;

This will show whole  numbers for the y-axis labels, and decimals for the point labels.

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...