pygal is customized with the help of the Config class (see config.py). It can be changed in several ways:
width, height, explicit_size
The simplest and usefull customizations is the svg size to render. It indicates the desired size of the svg.
You can also set explicit_size to True to add size attributes to the svg tag.
Spacing determines the space between all elements:
Margin is the external chart margin:
Scales are computed automaticaly between the min and the max values.
You may want to always have the absissa in your graph:
You may also want to explicitly set a range, range takes a tuple containing min and max:
Finaly you can tell at which precision pygal should stop scaling (in log10):
You can add a title to the chart by setting the title option:
You can add a title to the x axis by setting the x_title option:
You can add a title to the y axis by setting the y_title option:
You can specify x labels and y labels, depending on the graph type:
Set this to False to deactivate y labels:
Allow label rotation (in degrees) to avoid axis cluttering:
x_labels_major, x_labels_major_every, x_labels_major_count, show_minor_x_labels
You can alter major minor behaviour for the abscissa thanks to Arjen Stolk
You can remove dots by setting show_dots at False
You can remove legend by setting these at False
You can plot your values to 2 separate axes, thanks to wiktorn
fill, stroke, zero
You can disable line stroking:
And enable line filling:
To fill to an other reference than zero:
Set the various font size
By default long text are automatically truncated at reasonable length which fit in the graph.
You can override that by setting truncation lenght with truncate_legend and truncate_label.
Display values in human readable form:
1 230 000 -> 1.23M .00 098 7 -> 987µ
Text to display instead of the graph when no data is supplied: