Jump to content
Software FX Community

Pie chart legend data


rao

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...