Pie charts are quite different from the other chart types since they do not follow the concept of a two-dimensional grid or axes. Altering the diameter of the pie or the properties of the exploding slices can be accomplished with the properties of the Pie class.
Starting Angle
Use the Start property to specify the angle at which the slices for the first series start. The default angle is 0 degrees. The angle represents the arc between the most clockwise edge of the first slice and the right horizontal radius of the pie, as measured in the counter-clockwise direction (see image below). Start is a property of the Pie class and can be accessed at design time through the Pie node of the ChartGroupsCollection Editor.
Exploding Pies
A slice of a Pie chart can be emphasized by exploding it, which extrudes the slice from the rest of the pie. Use the Offset property of the series to set the exploded slice’s offset from the center of the pie. The offset is measured as a percentage of the radius of the pie.
Exploding slices can be set programmatically, and can be set for the series only:
'Get the appropriate ChartData object.
Dim cd As ChartData = C1Chart1.ChartGroups.ChartGroupsCollection(0).ChartData
'Sets the offset for the first series to 10% of the pie's radius
cd.SeriesList(0).Offset = 10
'Resets the exploded slices.
cd.SeriesList(0).Offset = 0
· C#
//Get the appropriate ChartData object.
ChartData cd = C1Chart1.ChartGroups.ChartGroupsCollection[0].ChartData;
//Sets the offset for the first series to 10% of the pie's radius
cd.SeriesList[0].Offset = 10;
//Resets the exploded slices.
cd.SeriesList[0].Offset = 0;
· Delphi
var
cd: ChartData;
begin
// Get the appropriate ChartData object.
cd := C1Chart1.ChartGroups.ChartGroupsCollection[0].ChartData;
// Sets the offset for the first series to 10% of the pie's radius.
cd.SeriesList[0].Offset = 10;
// Resets the exploded slices
cd.SeriesList[0].Offset = 0;
end;
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |