Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDPieChartMBS class.
CDPieChartMBS.Constructor(width as Integer = 640, height as Integer = 480, bgcolor as color, edgeColor as color, raisedEffect as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDPieChartMBS.Constructor(width as Integer = 640, height as Integer = 480, bgcolor as Integer = &hFFFF0000, edgeColor as Integer = &hFF000000, raisedEffect as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
width | (Mandatory) | The width of the chart in pixels. |
height | (Mandatory) | The height of the chart in pixels. |
bgColor | BackgroundColor | The background color of the chart. |
edgeColor | Transparent | The edge color of the chart. |
raisedEffect | 0 | The 3D border width. For positive values, the border will appear raised. For negative values, the border will appear depressed. A zero value means the border will appear flat. |
See also:
CDPieChartMBS.sector(sectorNo as Integer) as CDSectorMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
sectorNo | (Mandatory) | The sector number of the sector to retrieve, starting from 0. The first sector is 0. The nth sector is (n-1). |
The requested Sector object.
CDPieChartMBS.set3D(depth as Integer = -1, angle as Double = -1, shadowMode as boolean=false)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
depth | -1 | The 3D depth of the pie in pixels. -1 means the depth is automatically determined. |
angle | -1 | The 3D view angle in degrees. Must be 0 - 90 for standard 3D mode, and 0 - 360 in shadow 3D mode. -1 means the angle is automatically determined. |
shadowMode | false | Flag to indicate whether the pie is in standard 3D or shadow 3D mode. A true value means shadow 3D mode. A false value means standard 3D mode. |
See also:
CDPieChartMBS.set3D(depths() as Double, angle as Double = 45, shadowMode as boolean=false)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
depths | (Mandatory) | An array of integers representing the 3D depths for the sectors. |
angle | 45 | The 3D view angle in degrees. Must be 0 - 90 for standard 3D mode, and 0 - 360 in shadow 3D mode. -1 means the angle is automatically determined. |
shadowMode | false | Flag to indicate whether the pie is in standard 3D or shadow 3D mode. A true value means shadow 3D mode. A false value means standard 3D mode. |
See also:
CDPieChartMBS.setData(data() as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
data | (Mandatory) | An array of numbers representing the data points. |
labels | [Empty_Array] | An array of text strings representing the labels of the sectors. An empty array means no sector label. |
See also:
CDPieChartMBS.setData(data() as Double, label() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
data | (Mandatory) | An array of numbers representing the data points. |
labels | [Empty_Array] | An array of text strings representing the labels of the sectors. An empty array means no sector label. |
See also:
CDPieChartMBS.setDonutSize(x as Integer, y as Integer, r as Integer, r2 as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
x | (Mandatory) | The x coordinate of the donut center. |
y | (Mandatory) | The y coordinate of the donut center. |
r | (Mandatory) | The inner radius of the donut. |
r2 | (Mandatory) | The outer radius of the donut. |
Some examples using this method:
- /ChartDirector/chart like watch
- /ChartDirector/donut
- /ChartDirector/High Resolution Chart Examples/smallsectorpie
- /ChartDirector/High Resolution Chart Examples/threeddonutshading
- /ChartDirector/icondonut
- /ChartDirector/quadview
- /ChartDirector/simplePie with DynaPDF
- /ChartDirector/texturedonut
- /ChartDirector/threeddonut
- /ChartDirector/threeddonutshading
CDPieChartMBS.setExplode(sectorNo as Integer, distance as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
sectorNo | (Mandatory) | The sector number of the sector to be exploded from the pie, starting from 0. The first sector is 0. The nth sector is (n - 1). |
distance | -1 | The explosion distance in pixels. -1 means the distance is automatically determined. |
CDPieChartMBS.setExplodeGroup(startSector as Integer, endSector as Integer, distance as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
startSector | (Mandatory) | The sector number of the first sector in the sector group to be exploded. The first sector is 0. The nth sector is (n - 1). |
endSector | (Mandatory) | The sector number of the last sector in the sector group to be exploded. The first sector is 0. The nth sector is (n - 1). |
distance | -1 | The explosion distance in pixels. -1 means the distance is automatically determined. |
Some examples using this method:
CDPieChartMBS.setJoinLine(joinLineColor as color, joinLineWidth as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDPieChartMBS.setJoinLine(joinLineColor as Integer, joinLineWidth as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the color and width of the join line for one particular sector only, use Sector.setJoinLine.
By default, for circular label layout, the join line color is Transparent. For side label layout, the join line color is SameAsMainColor.
Argument | Default | Description |
joinLineColor | (Mandatory) | The color of the line that joins the sector perimeter with the sector label. |
joinLineWidth | 1 | The line width of the join line. |
See also:
CDPieChartMBS.setLabelFormat(formatString as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the label format for one particular sector only, use Sector.setLabelFormat.
The default sector label format depends on the label layout method used (see PieChart.setLabelLayout).
Label Layout MethodDefault Label Format
Circular Layout | {label}<*br*>{percent}% |
Side Layout | {label} ({percent}%) |
Please refer to Parameter Substitution and Formatting on all available parameters and how to format them.
Argument | Default | Description |
formatString | (Mandatory) | The format string. |
CDPieChartMBS.setLabelLayout(layoutMethod as Integer, pos as Integer = -1, topBound as Integer = -1, bottomBound as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the sector label layout method and location for one particular sector only, use Sector.setLabelLayout.
ChartDirector supports two sector label layout methods - circular layout and side layout. The layout method is determined using the layoutMethod argument, which must be one of the following predefined constants.
ConstantValueDescription
SideLayout | 0 | Side Label Layout |
CircleLayout | 1 | Circular Label Layout |
In the circular layout method, the sector labels are positioned around the perimeter of the pie.
In the side layout method, there is an invisible rectangle containing the pie, where the rectangle can be wider than the diameter of the pie.The sector labels are positioned on the left and right sides outside the rectangle. Because the labels can be quite far away from the sectors, join lines are typically used to connect the labels to the sectors.
The circular layout method usually uses less space and is the default layout method. However, if the pie chart contains a lot of small sectors, the labels may overlap with each others, due to insufficient space on the pie perimeter to position the labels.
The side layout method has the advantages that it can avoid label overlapping. In the side layout method, labels will automatically shift up and down to avoid overlapping.
One common issue in pie charts is the data contain a lot of small sectors. If the data are sorted, the small sectors will be crowded together instead of distributed evenly. Although the side layout method can avoid label overlapping by shifting the labels up and down, some labels may need to be shifted great distances.
Label layout can often be improved if the small sectors are near the horizontal axis. It is because the amount of vertical label space for a sector is greatest at the horizontal axis. This can be achieved by choosing an appropriate start angle (using PieChart.setStartAngle).
If the data is in ascending order (small sectors crowded at the beginning), a start angle of 45 degrees with clockwise sector layout is recommended. With this setting, the first few sectors (the smallest sectors) will be at around 45 - 135 degrees, so is near the horizontal axis (90 degrees). Similarly, if the data is in descending order (small sectors crowded at the end), a start angle of 135 degrees with clockwise sector layout can be used.
Argument | Default | Description |
layoutMethod | (Mandatory) | Specify the layout method. Must be one of the predefined constants CircleLayout or SideLayout. |
pos | -1 | For circular layout, it is the distance between the sector perimeter and the sector label. A negative value (but not -1) means the sector label will be drawn in the interior of the sector. |
For side layout, it is the distance between the pie perimeter and the left or right edges of the invisible containing rectangle (equal to the width of the rectangle minus the pie diameter and then divided by 2).
In either case, -1 means the distance is automatically determined.
topBound | -1 | This parameter applies only to side label layout. It controls the top bound of the labels (the minimum y coordinate), thereby limiting the extent that the labels can be shifted up to avoid overlapping. This parameter is typically used avoid the labels from moving up too much and overlap with other chart objects (such as the chart title). |
bottomBound | -1 | This parameter applies only to side label layout. It controls the bottom bound of the labels (the maximum y coordinate), thereby limiting the extent which the labels can be shifted down to avoid overlapping. This parameter is typically used to avoid the labels from moving down too much and overlap with other chart objects. |
CDPieChartMBS.setLabelPos(pos as Integer, joinLineColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDPieChartMBS.setLabelPos(pos as Integer, joinLineColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the sector label position or join line color for one particular sector only, use Sector.setLabelPos.
Argument | Default | Description |
pos | (Mandatory) | The distance between the sector perimeter and the sector label. A negative value means the sector label will be drawn in the interior of the sector. |
joinLineColor | -1 | The color of the line that joins the sector perimeter with the sector label. The default is Transparent. The join line is ignored if the sector label is inside the sector. |
See also:
CDPieChartMBS.setLabelStyle(font as string = "", fontsize as Double = 8, fontColor as Integer = &hffff0002) as CDTextBoxMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the label style for one particular sector only, use Sector.setLabelStyle.
See Font Specification for details on various font attributes.
Argument | Default | Description |
font | "" | The font used to draw the sector labels. |
fontSize | 8 | The font size in points. |
fontColor | TextColor | The text color for the sector labels. |
A TextBox object representing the prototype of the obj. This may be used to fine-tune the appearance of the obj.
See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml
See also:
CDPieChartMBS.setLabelStyle(font as string, fontsize as Double, fontColor as color) as CDTextBoxMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDPieChartMBS.setLineColor(edgeColor as color, joinLineColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
CDPieChartMBS.setLineColor(edgeColor as Integer, joinLineColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the sector label position and join line color for one particular sector, use Sector.setColor.
Argument | Default | Description |
edgeColor | (Mandatory) | The colors for the edges of the sectors. By default, the edge color is SameAsMainColor, which means the edge color is the same as the fill color of the sector, and the sector will appear borderless. |
joinLineColor | -1 | The color of the line that join the sector perimeter with the sector label. By default, for circular label layout, the join line color is Transparent. For side label layout, the join line color is SameAsMainColor. |
See also:
CDPieChartMBS.setPieSize(x as Integer, y as Integer, r as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
x | (Mandatory) | The x coordinate of the pie center. |
y | (Mandatory) | The y coordinate of the pie center. |
r | (Mandatory) | The radius of the pie. |
Some examples using this method:
- /ChartDirector/explodedpie
- /ChartDirector/High Resolution Chart Examples/legendpie2
- /ChartDirector/iconpie2
- /ChartDirector/multidepthpie
- /ChartDirector/sidelabelpie
- /ChartDirector/simplePie with Cyrillic
- /ChartDirector/simplePie with MouseClicks
- /ChartDirector/simplePie with MouseClicks explode
- /ChartDirector/simplePie with Thai
- /ChartDirector/threedpieshading
CDPieChartMBS.setSectorStyle(shadingMethod as Integer, edgeColor as color, edgeWidth as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control for Web
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/donutshading
- /ChartDirector/explodedpie
- /ChartDirector/High Resolution Chart Examples/legendpie2
- /ChartDirector/legendpie2
- /ChartDirector/Place PDF Chart with DynaPDF
- /ChartDirector/threeddonutshading
- /ChartDirector/threedpieshading
CDPieChartMBS.setSectorStyle(shadingMethod as Integer, edgeColor as Integer = -1, edgeWidth as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method affects all sectors. To set the sector shading style, edge color and edge width for one particular sector, use CDSectorMBS.setStyle.
ChartDirector supports various shading effects, which are best illustrated using examples.
The followings are textual descriptions of the shading effects.
Constant | Value | Description |
DefaultShading | 0 | This is the default shading method. The top surfaces are shaded with flat colors. For 3D sectors, the cylindrical surfaces are shaded with cylindrical lighting effects. |
FlatShading | 1 | All surfaces are shaded with flat colors. |
LocalGradientShading | 2 | The top surfaces are shaded with linear gradient colors. For each sector, the gradient is from the bottom of the sector bounding box to the top of the sector bounding box, with the bottom side brighter and the top side darker. For 3D sectors, the cylindrical surfaces are shaded with cylindrical lighting effects. |
GlobalGradientShading | 3 | The top surfaces are shaded with linear gradient colors. The gradient is from the bottom the pie bounding box to the top of the pie bounding box, with the bottom side brighter and the top side darker. For 3D sectors, the cylindrical surfaces are shaded with cylindrical lighting effects. |
ConcaveShading | 4 | The top surfaces are shaded with a special effect so that they look concave, with the pie center appears to be depressed relative to the perimeter. For 3D sectors, the cylindrical surfaces are shaded with cylindrical lighting effects. |
RoundedEdgeShading | 6 | The top surfaces are shaded with a special effect so that the pie looks raised with a rounded raised edge at the perimeter. |
RadialShading | 7 | The top surfaces are shaded with radial gradient colors, with the pie center brighter and the perimeter darker. For 3D sectors, the cylindrical surfaces are shaded with cylindrical lighting effects. |
RingShading | 8 | This effect is intended to be used with 2D donut charts only. The top surfaces are shaded with a special effect so that a 2D donut will look like a torus. |
Arguments:
Argument | Default | Description |
shadingMethod | (Mandatory) | The sector shading style to use, which must be one of the constants in the table above. -1 means to keep the existing value unchanged. |
edgeColor | -1 | The edge color of the sectors. -1 means to keep the existing value unchanged. |
edgeWidth | -1 | The edge width of the sectors. -1 means to keep the existing value unchanged. |
See also:
CDPieChartMBS.setStartAngle(startAngle as Double, clockWise as boolean=true)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
By default, the start angle is 0 degree (the upward pointing direction), and subsequent sectors are drawn clockwise.
Argument | Default | Description |
startAngle | (Mandatory) | The angle to start drawing the first sector in degrees. The angle is measured from the upward pointing direction in the clockwise direction. |
clockWise | true | Flag to control the layout direction of the sectors. A true value means clockwise. A false value means anti-clockwise. |
The items on this page are in the following plugins: MBS ChartDirector Plugin.