Skip to content

Latest commit

 

History

History
98 lines (63 loc) · 1.64 KB

sizing.rst

File metadata and controls

98 lines (63 loc) · 1.64 KB

Sizing

Svg size is configurable with width and height parameter.

width

200 400

chart = pygal.Bar(width=200) chart.add('1', 1) chart.add('2', 2)

height

600 100

chart = pygal.Bar(height=100) chart.add('1', 1) chart.add('2', 2)

explicit_size

Size can be written directly to the svg tag to force display of the requested size using explicit_size.

spacing

Spacing determines the space between all elements:

chart = pygal.Bar(spacing=50) chart.x_labels = u'αβγδ' chart.add('line 1', [5, 15, 10, 8]) chart.add('line 2', [15, 20, 8, 11])

margin

Margin is the external chart margin:

chart = pygal.Bar(margin=50) chart.x_labels = u'αβγδ' chart.add('line 1', [5, 15, 10, 8]) chart.add('line 2', [15, 20, 8, 11])

Individual margins can also be specified

margin_top

chart = pygal.Bar(margin_top=50) chart.x_labels = u'αβγδ' chart.add('line 1', [5, 15, 10, 8]) chart.add('line 2', [15, 20, 8, 11])

margin_right

chart = pygal.Bar(margin_right=50) chart.x_labels = u'αβγδ' chart.add('line 1', [5, 15, 10, 8]) chart.add('line 2', [15, 20, 8, 11])

margin_bottom

chart = pygal.Bar(margin_bottom=50) chart.x_labels = u'αβγδ' chart.add('line 1', [5, 15, 10, 8]) chart.add('line 2', [15, 20, 8, 11])

margin_left

chart = pygal.Bar(margin_left=50) chart.x_labels = u'αβγδ' chart.add('line 1', [5, 15, 10, 8]) chart.add('line 2', [15, 20, 8, 11])