How to show label with two decimal places in MSChart?

If you are using MSChart to display your data in chart and want some numerical value to display in the label or tooltip with two decimal places then set them as shown below (c# code snippet):

// Set tooltip with value from x axis & y axis
this.Chart1.Series[“Series1″].ToolTip = “#VALX” + “(” + “#VALY{0.##}” + ” GB )”;

// Set Label value with value from x axis & y axis
this.Chart1.Series[“Series1″].Label = “#VALX” + “(” + “#VALY{0.##}” + ” GB )”;

And the diagram will be as shown below

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Hit Counter provided by Curio cabinets