This document explains how to specify the colors you want to use in your chart.
Specify chart colors with a 6-letter string of hexadecimal values in the format RRGGBB. For example:
FF0000 = red00FF00 = green0000FF = blue000000 = blackFFFFFF = whiteYou can optionally specify transparency by appending a hexadecimal value
between 00 and FF, where 00 is completely
transparent and FF is completely opaque. For example:
0000FFFF = solid blue0000FF00 = transparent blueSpecify colors for line charts, bar charts, Venn diagrams, Google-o-meters, radar charts, maps, scatter plots, and pie charts with
chco=
<color 1>,
...
<color n>
Where each <color> is an RRGGBB format hexadecimal number.
Specify a color for each data point within a single data set by separating
the color parameters by using the pipe character (|). This feature
is available for bar charts, pie charts, scatter plots and maps.
| Parameter | Description | Example |
|---|---|---|
|
This example has three data sets and three colors specified. |
|
This example also has three data sets, but only two colors are specified. Because the color for the third data set is unspecified, the third line is drawn in the first color (red). If you specify fewer colors than data sets, the first data set with unspecified colors uses the first specified color, the second data set with unspecified colors uses the second specified color, and so on. |
|
|
For bar charts, if there are fewer colors than data sets, the first bar with unspecified colors will use the first specified color, the second bar with unspecified colors will use the second specified color, and so on. In the following chart, the third data set, |
|
|
Here's the same chart with three colors specified. |
|
|
This example shows a bar chart with two data sets. The
first data set is shown in black ( |
|
|
For pie charts, if there are fewer color than slices, then colors are interpolated. |
|
|
| For Venn diagrams, if there are fewer colors than circles, the last color specified is repeated. |
|
|
| For Google-o-meters, specify at least two colors. To control the color gradient across the Google-o-meter, specify more colors. | chco=FF0000,FF8040,FFFF00, |
Specify a fill area with
chm=
b,<color>,<start line index>,<end line index>,<any value>|
...
b,<color>,<start line index>,<end line index>,<any value>
Where:
<color> is an RRGGBB format hexadecimal number.<start line index> is the index of the line at which
the fill starts. The first data set specified in chd has an index of zero (0),
the second data set has an index of 1, and so on.<end line index> is the index of the line at which
the fill ends. The first data set specified in chd has an index of zero (0),
the second data set has an index of 1, and so on.<any value> is ignored. Multiple fill areas are separated using the pipe character (|).
| Parameter | Description | Example |
|---|---|---|
|
Specify the data set with the largest values first. To fill from the top of the chart to the first line, include a data
set which contains only the highest data value ( To fill from the last line to the bottom of the chart include a data
set which contains only the lowest data value ( The lines themselves are drawn in black, using
|
|
By contrast, the first and last data sets
( The |
|
|
|
For a single data set, it is simpler to use This is the only
fill area type available for radar charts. |
|
Specify solid fill with
chf=
<fill type>,s,<color>|
<fill type>,s,<color>
Where:
<fill type> is:bg for background fillc for chart area fill a to apply transparency to the whole chart.s indicates solid fill.<color> is an RRGGBB format hexadecimal number.|) separates fill definitions. No pipe character is required after the second definition.You can specify:
| Parameter | Description | Example |
|---|---|---|
|
This example fills the image background with pale gray ( |
|
This example fills the background with pale gray ( |
|
|
This example shows the effect of specifying transparency using the hexadecimal values of 20 for the background and 80 for the chart area. |
|
|
| This example applies transparency to the whole chart. |
|
Specify linear gradient for line charts, bar charts, Venn diagrams, radar charts, and scatter plots with
chf=<fill type>,lg,<angle>,<color 1>,<offset 1>,<color n>,<offset n>
Where:
<fill type> is one of the following:
bg for background
fillc for chart area fill.lg specifies linear gradient.<angle> specifies the angle of the gradient between 0 (horizontal) and 90 (vertical).<color> is a RRGGBB format hexadecimal number.<offset> specifies at what point the color
is pure. In this parameter, 0 specifies the right-most
chart position and 1 specifies the left-most chart position.| Parameter | Description | Example |
|---|---|---|
|
Chart area has a horizontal (left to right) linear gradient, specified with an angle of zero degrees ( Blue ( White ( The chart background is drawn in gray ( |
|
Chart area has a diagonal (bottom left to top right) linear gradient, specified with an angle of forty-five degrees ( White ( Blue ( The chart background is drawn in gray ( |
|
|
Chart area has a vertical (top to bottom) linear gradient, specified with an angle of ninety degrees ( Blue ( White ( The chart background is drawn in gray ( |
|
Specify linear stripes for line charts, bar charts, Venn diagrams, radar charts, and scatter plots with
chf=<fill type>,ls,<angle>,<color 1>,<width 1>,<color n>,<width n>
Where:
<fill type> is one of the following:
bg for background
fillc for chart area fill.ls specifies linear stripes.<angle> specifies the angle of the gradient relative
to the y-axis. Use 0 for vertical stripes, or 90 for horizontal stripes.<color> is an RRGGBB format hexadecimal number.<width> must be between 0 and 1, where 1 is the full width of the chart. Stripes are repeated until the chart is filled.| Parameter | Description | Example |
|---|---|---|
|
Chart area with stripes whose angle is zero
( The first stripe is drawn using the first color specified (dark
gray, The second stripe is drawn using the second color specified (white, Stripes alternate until the chart is filled. The stripes fill the chart background as well as the plot area. |
|
Chart area with horizontal stripes whose angle is ninety degrees ( The first stripe is drawn using the first color specified (the
darkest gray, The second and third stripes are drawn in the second and third colors
specified (the lighter gray, Stripes alternate until the chart is filled. The stripes fill the plot area, but the chart background is omitted. |
|