Jump to content
Software FX Community

Pie chart legend data


rao
 Share

Recommended Posts

In order to show a label inside a pie slice, you need to enable the point labels for that slice and set the point labels format with one of the pre-defined variable settings; please refer to the ChartFX documentation for more information about this property.

chart1.Points[0, 0].PointLabels.Format = "%L";

chart1.Points[0, 0].PointLabels.Visible =

true;

In addition, you can set the Text property of the particular point you want to show the point label for, and the %L of the point labels format will show this value.

chart1.Points[0, 0].Text =

"Slice 1";
Link to comment
Share on other sites

As I mentioned before, you can set the Text property of each individual pie slice and then use the %L variable setting of the PointLabels.Format property to show those values; in addition, you can use the %p variable setting to show the percentage that this pie slice represents. You can do as follows:

chart1.AllSeries.PointLabels.Visible = true;

chart1.Points[0, 0].Text =

"Slice 1";chart1.Points[0, 1].Text = "Slice 2";

chart1.Points[0, 2].Text =

"Slice 3";chart1.Points[0, 0].PointLabels.Format = "%L" + " is %p%%"; chart1.Points[0, 1].PointLabels.Format = "%L" + " is %p%%";

chart1.Points[0, 2].PointLabels.Format =

"%L" + " is %p%%";

For more information about these variable settings, please refer to the Format property of the PointLabelAttributes class in the Samples & Resource Center (Documentation installed with the product).

X-Axis labels.zip

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