Skip to content

Chart Label

You can specify labels for individual slices (in pie, doughnut or polar chart) or bar using the chl parameter. You can also display a legend with the same or different values, one legend entry per slice. Use \n for multi-line labels.

Who said we should just copy Google Image Charts?

Google Image Charts only supported chl parameter for pie chart slices. In Image-Charts we've extended support for every one of our charts, enjoy 👍🚀

A Note on String Values

Only URL-safe characters are permitted in label strings. To be safe, you should URL-encode any strings containing characters not in the character set 0-9a-zA-Z.

Syntax

chl=
  <label_value>|
    ...
  <label_value>
  • <label_value> A string value to apply to a slice or bar. Labels are applied consecutively to the data points in chd. If you have multiple series (for a concentric pie chart, for example), labels are applied to all points in all sequences, in the order specified in chd. Use a pipe delimiter ( | ) between each label. Specify a missing intervening value by using two consecutive pipe characters with no space between them: || . You do not need to label all slices.

Examples

Let specify labels for a simple animated pie chart.

chart

cht=p3
chd=t:20,20,30,40,50
chl=20°|20°|30°|40°|50°

Same as the previous chart but this time as an animated donught chart.

chart

cht=pd
[...]

And now a concentric pie charts with labels for each slices.

chart

chs=700x200
chd=t:1,2,3,4|10,40,100,100
chl=A|B|C|D|E|F|G|H

Here is an example of a line chart with label on some points, to do that we skip label using ||.

chart

chl=Go!||||||oops||||||Yes!|||||||||not\nagain||||||||||||||oh boy

A bar chart with text inside each bar. Note that we only display the Y axis with chxt=y.

chart

chxt=y
chl=a|b|c|d|e|f

A bubble chart with text inside each bubble.

chart

cht=bb&
chl=label 1|label 2