BPCharts

   

Table of Contents

  1. Overview
  2. Getting Started
  3. Colors (chco)
  4. Fills (chf)
  5. Line Color (chlco)
  6. Pie Rotation (chp and chpd)

Overview

The Pie Chart is used to display proportional part to whole relationships. The chart type code for this chart is p.

Getting Started

Description Image
Pie chart values are rendered in order starting from the north and proceeding clockwise.
chd=t:25,20,
  15,10,10,5,5,
  5,5
Values are always rescaled so that a complete circle is drawn.
chd=t:10,10,10
As with all charts, you can specify data using different data encodings. See data encodings for more information.
chd=s:sengelha
As with all charts, the chart size is controllable using the chs parameter.
chs=75x75
As with all charts, you can generate other image types using the chof parameter.
chof=s (SVG)

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

Syntax

chco=<color_1>,...,<color_n>
<color>
The color, in RRGGBB or RRGGBBAA format, to apply to the pie slice.

Example

Description Image
Change the pie chart color scheme to a Morningstar-like palette.
chco=9F375F|E87B1E|F2C108|
  88AC2E|007581|789CC2|
  4F6688
Make all pie 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|
  F2C108E0|88AC2EE0|
  007581E0|789CC2E0|
  4F6688E0
chf=bg,s,00000000
Draw a pie 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
chco=F2C108|00000000|
  F2C108
chf=bg,s,00000000

Fills (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).

Syntax

chf=<fill_type>,s,<color>
<fill_type>

The part of the chart being filled. Specify one of the following values:

  • bg - Background fill
s
Indicates a solid fill.
<color>
The fill color, in RRGGBB or RRGGBBAA format.

Example

Description Image
Fill the chart background with pale grey (EFEFEF).
chf=bg,s,EFEFEF
Fill the chart background with semi-transparent blue (0000FFCC).
chf=bg,s,0000FFCC

Line Color (chlco)

By default, there are no lines separating pie slices from one another. This can be controlled using the line color (chlco) option.

Syntax

chlco=<line_color>
<line_color>
The color, in RRGGBB or RRGGBBAA format, of the pie slice separating lines.

Example

Description Image
Add white lines separating the pie slices.
chlco=FFFFFF

Pie Rotation (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.

Syntax

chp=<radians>
chpd=<degrees>
<radians>
A floating point value describing how many radians to rotate the chart clockwise.
<degrees>
A floating point value describing how many degrees to rotate the chart clockwise.

Example

Description Image
Rotate the pie chart 90 degrees clockwise.
chpd=90