Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Jun 6, 2016
1 parent 6a597e2 commit 969ab5f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/documentation/configuration/serie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Serie configuration
How
---

Series are customized using keyword args set in the ``add`` function:
Series are customized using keyword args set in the ``add`` or call function:

.. code-block:: python
chart = pygal.Line()
chart.add('', [1, 2, 3], fill=True)
chart(1, 2, 3, fill=True)
chart.add('', [3, 2, 1], dot=False)
Expand Down
8 changes: 8 additions & 0 deletions docs/documentation/first_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ And finally add a title and some labels:
bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55])
bar_chart.add('Padovan', [1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12])

The public API is chainable and can be simplified as call arguments, the last chart can be also written:

.. code-block:: python
bar_chart = pygal.HorizontalStackedBar(
title="Remarquable sequences", x_labels=map(str, range(11))(
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, title='Fibonacci')(
1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12, title='Padovan')
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Simple python charting

.. pygal-code:: inline

pygal.Bar().add('1', [1, 3, 3, 7]).add('2', [1, 6, 6, 4]).render()
pygal.Bar()(1, 3, 3, 7)(1, 6, 6, 4).render()


Index
Expand Down

0 comments on commit 969ab5f

Please sign in to comment.