Example usage:
import cartesius.main as cartesius
import cartesius.elements as elements
import cartesius.charts as charts
coordinate_system = cartesius.CoordinateSystem()
# list or tuple of two-element tuples (value, label):
piechart_data = (
charts.data('abc', 1),
charts.data('cde', 2),
charts.data('efg', 4),
charts.data('ijk', 1),
charts.data('lmn', 5),
charts.data('opq', 5),
charts.data('xyz', 3),
)
piechart = charts.PieChart(data=piechart_data, color=(0, 0, 0))
coordinate_system.add(piechart)
# No need for axes:
coordinate_system.add(elements.Axis(horizontal=True, hide=True))
coordinate_system.add(elements.Axis(vertical=True, hide=True))
The result is:
More examples in the README.
No comments:
Post a Comment