|
Table of Contents
OverviewThe Donut/Pie Chart is used to display proportional part to whole relationships. The chart type code for this chart is This chart is an extension of the functionality of Pie charts, allowing the creation of donut and pie charts in both 2D and 3D.
Getting Started(
|
Description | Image |
---|---|
By default, dn chart type will render a 3D pie chart, with the depth and angle determined automatically. |
cht=dn
|
chvap
)Description | Image |
---|---|
2D Donut chart. Just as in Pie charts, values are rendered in order starting from the north and proceeding clockwise. |
chvap=2,0,0
|
2D Pie Chart set by setting inner radius to 0 . |
chvap=0,0,0
|
As with all charts, you can specify data using different data encodings. See data encodings for more information.
Pie with 10pixels depth at 90deg angle |
chd=s:sengelha chvap=0,10,30
|
Donut chart, 10pixels depth at 170deg angle |
chd=s:sengelha chvap=2,10,170
|
Donut chart, 10pixels depth at 170deg angle Inner radius set to value above 4, resulting in calculated radius(based on chart dimensions), becoming the inner radius |
chd=s:sengelha chvap=7,10,170
|
Pie with 10pixels depth at 90deg angle, shadow mode set to true |
chd=s:sengelha chvap=0,10,30,true
|
Donut chart, 10pixels depth at 170deg angle, shadow mode set to true, shadow style set to ring shadow
Shadow Mode is only read by charts, when in pie mode. Donut charts will not read this parameter. |
chd=s:sengelha chvap=2,10,170,true,8
|
Pie with 10pixels depth at 90deg angle, shadow mode set to true, shadow style set to concave shading |
chd=s:sengelha chvap=0,10,30,true,4
|
As with all charts, you can generate other image types using the chof parameter. |
chof=s (SVG)chvap=2,10,170
chof=s (SVG)chvap=0,10,170
|
chco
)Users can explicitly choose the colors they want to render the individual pie
slices using the chco
option. By default, BPCharts renders pie
slices using an automatically-generated color gradient.
See also Colors.
chco=<color_1>,...,<color_n>
Description | Image |
---|---|
Donut chart color with Morningstar-like palette. 10pixels depth at 45deg angle |
chco=9F375F|E87B1E|F2C108|
chvap=2,10,45
|
Pie chart with Morningstar-like color palette. 20pixels depth at 45deg angle |
chco=9F375F|E87B1E|F2C108|
chvap=0,20,45
|
Make all donut slices semi-transparent using an alpha value of E0 . Note: You'll generally want to make the chart background transparent as well, see Fills (chf ). |
chco=9F375FE0|E87B1EE0|
chvap=2,10,45
|
Draw a donut with a "missing" slice by using a transparent color (00000000 ). Note: You'll generally want to make the chart background transparent as well, see Fills (chf ). |
chd=t:15,20,65
chvap=2,10,45
|
chf
)
The background color of the chart can be controlled using the chart fill option.
The default fill color for the pie chart is white (FFFFFF
).
chf=<fill_type>,s,<color>
The part of the chart being filled. Specify one of the following values:
bg
- Background fillDescription | Image |
---|---|
Fill the chart background with pale grey (EFEFEF ). |
chf=bg,s,EFEFEF chvap=0,10,45 |
Fill the chart background with semi-transparent blue (0000FFCC ). |
chf=bg,s,0000FFCC chvap=2,10,45 |
chlco
)
By default, there are no lines separating pie slices from one another. This can be controlled using
the line color (chlco
) option.
chlco=<line_color>
Description | Image |
---|---|
Add white lines separating the pie slices. |
chlco=FFFFFF chvap=0,10,45 |
Add white lines separating the donut slices. |
chlco=FFFFFF chvap=2,10,45 |
chm=N
)You can combine markers with
any other chm
parameters using a pipe character ( |
)
to separate the chm
parameters.
Syntax
Specify one set of the following parameters for each series that should be marked. To mark multiple series, create additional parameter sets, delimited by a pipe character. You do not need to mark up all series. If you do not assign markers to a data series, it will not get any markers.
chm= [@]<marker_type>,<color>,<series_index>,<opt_which_points>,<size>,<opt_z_order> |...| [@]<marker_type>,<color>,<series_index>,<opt_which_points>,<size>,<opt_z_order>
N<opt_format_string>
- The value of the data at this point, with optional formatting. N<preceding_text>*<number_type><decimal_places>zs<x
or y>*<following_text>
<preceding_text>
- Literal text to precede each value.*...*
- An optional block wrapped in literal asterisks,
in which you can specify formatting details for numbers. The following
values are supported, and are all optional:
<number_type>
- The number format, for numeric values. Choose one of the following:
f
- [Default] Floating point format.p
- Percentage format. A % sign is appended automatically. Note: When
using this format, data values from 0.0 — 1.0 map to 0 — 100%
(for example, 0.43 will be shown as 43%).e
- Scientific notation format.c<CUR>
- Format the number in the
currency specified, with the appropriate currency marker. Replace <CUR>
with
a three-letter currency code. Example: cEUR
for Euros.
You can find a list of codes on the ISO
web site, although not all symbols are supported.<decimal_places>
- An integer specifying
how many decimal places to show. The value is rounded (not truncated)
to this length. Default is 2.z
- Display trailing zeros. Default is no.s
- Display group separators. Default is no.x
or y
- This parameter is not currently supported - its content will be ignored.<following_text>
- Literal text to follow each value.Description | Image |
---|---|
Add value markers as percentages at each sector. |
chlco=FFFFFF chvap=0,10,45 chm=N*f1*%25,000000,0,-1,10
|
Add value markers as GBP at each sector, with £ml notation. |
chlco=FFFFFF chvap=2,10,45 chm=N*cGBP*£ml,000000,0,-1,10
|
chlp
)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.
chlp=<distance>,<joinlineColor>,<layout>
0
- Side Label Layout, 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. 1
- Circular Label Layout, the sector labels are positioned around the perimeter of the pie Description | Image |
---|---|
Add value markers inside each sector. | |
Add value markers outside chart, in side layout mode |
chlco=FFFFFF chvap=2,10,45 chm=N*f1*%25,000000,0,-1,10 chlp=20,0B6138,0
|
Add value markers outside chart, in circular layout mode |
chlco=FFFFFF chvap=2,10,45 chm=N*f1*%25,000000,0,-1,10 chlp=20,0B6138,1
|
chp
and chpd
)
By default, the pie chart pieces are rendered in order starting from
the north and proceeding clockwise. You can change the starting
orientation by using the pie rotation (chp
) or
pie rotation in degrees (chpd
) parameter.
chp=<radians>
chpd=<degrees>
Description | Image |
---|---|
Rotate the donut chart 90 degrees clockwise. |
chvap=2,10,45 chpd=90
|
Rotate the pie chart 90 degrees counter clockwise. |
chvap=0,10,45 chpd=-90
|
chvas
)This setting adds 3D effects to the pie/donut, where each sector can have a different 3D depth
chvas=<sector_0>,...,<sector_n+1>|<depth_0>,...,<depth_n+1>
Description | Image |
---|---|
Donut chart with Morningstar-like color palette. 10pixels depth at 45deg angle Multi depth set at each sector |
chco=9F375F|E87B1E|F2C108|
chvap=2,10,45
chvas=0,8,10,15,20,25,35
|
Pie chart with Morningstar-like palette color scheme. 20pixels depth at 45deg angle Multi depth set at each sector With 45deg rotation |
chco=9F375F|E87B1E|F2C108|
chvap=0,20,45
chvas=0,8,10,15,20,25,35
chpd=45
|
chvax
)This "explodes" a sector/s from the pie/donut.
chvas=<sector_0>,...,<sector_n+1>|<distance_0>,...,<distance_n+1>
Description | Image |
---|---|
Donut chart with Morningstar-like color palette. 10pixels depth at 45deg angle Explode all sectors by 20 pixels |
chco=9F375F|E87B1E|F2C108|
chvap=2,10,45
chvax=-1|20
|
Pie chart with Morningstar-like color palette. 20pixels depth at 45deg angle Multi depth set at each sector With 15deg rotation Explode sectors 1 and 3 by 30 and 15 pixels |
chco=9F375F|E87B1E|F2C108|
chvap=0,20,45
chpd=15
chvax=1,3|20,15
|
Pie chart with Morningstar-like color palette. 20pixels depth at 45deg angle Multi depth set at each sector With 45deg rotation Explode all sectors, with distance set by chart engine |
chco=9F375F|E87B1E|F2C108|
chvap=0,20,45
chpd=45
chvax=-1
|