Jump to content
Software FX Community

Thousand Separator - Point Labels


patelajk
 Share

Recommended Posts

Hi 

I have a pie chart with some point labels on it and want to display them as 20,000 instead of 20000.

Any ideas on how to do this??

I know you can use:

Chart1.AllSeries.PointLabels.Format = "%v"

to display the value but I dont know how to get the separator in there

 Thanks

Link to comment
Share on other sites

 Hi,

Please look at the following snippet. The point labels will use the format set to the Y Axis.

  // Define Chart Object and Points   int nSeries = 1;   int nPoints = 5;   Chart1.Gallery = Gallery.Pie;   Chart1.Data.Series = nSeries;   Chart1.Data.Points = nPoints;   // Add sample data to Chart   Chart1.Data[0, 0] = 45000;   Chart1.Data[0, 1] = 75000;   Chart1.Data[0, 2] = 25000;   Chart1.Data[0, 3] = 35000;   Chart1.Data[0, 4] = 85000;   // Configure Point Labels.   Chart1.AxisY.LabelsFormat.Culture = new System.Globalization.CultureInfo("en-US");   Chart1.AxisY.LabelsFormat.Format = AxisFormat.Currency; // optional.   Chart1.AxisY.LabelsFormat.Decimals = 2;   // Make all series to show the value as point labels and show only series 1   Chart1.Series[0].PointLabels.Visible = true;   Chart1.AllSeries.PointLabels.Format = "%v";

 

Hope this helps.

 

Link to comment
Share on other sites

 Hi, Try this code:

  // Define Chart Object and Points   int nSeries = 1;   int nPoints = 5;   Chart1.Gallery = Gallery.Pie;   Chart1.Data.Series = nSeries;   Chart1.Data.Points = nPoints;   // Add sample data to Chart   Chart1.Data[0, 0] = 45000;   Chart1.Data[0, 1] = 75000;   Chart1.Data[0, 2] = 25000;   Chart1.Data[0, 3] = 35000;   Chart1.Data[0, 4] = 85000;   // Configure Point Labels.   Chart1.AxisY.LabelsFormat.Culture = new System.Globalization.CultureInfo("en-US");   Chart1.AxisY.LabelsFormat.Format = AxisFormat.Number; // display as number (no currency $).   Chart1.AxisY.LabelsFormat.Decimals = 2;   // Make all series to show the value as point labels and show only series 1   Chart1.Series[0].PointLabels.Visible = true;   Chart1.AllSeries.PointLabels.Format = "%v mn"; 

post-7406-13922413085904_thumb.jpg

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