Skip to content

Commit

Permalink
Going on doc + Fix y_labels behaviour for lines + Fix x_labels and y_…
Browse files Browse the repository at this point in the history
…labels behaviour for xy like + Improve gauge a bit + Finally allow call chains on add
  • Loading branch information
paradoxxxzero committed Jul 7, 2015
1 parent b63bd3f commit 2531304
Show file tree
Hide file tree
Showing 33 changed files with 871 additions and 676 deletions.
2 changes: 2 additions & 0 deletions demo/moulinrouge/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def test_gauge():

gauge.range = [-10, 10]
gauge.add('Need l', [2.3, 5.12])
gauge.add('Need m', [-4])
gauge.add('Need z', [-10, 10.5])
gauge.add('No', [99, -99])
return gauge.render_response()

Expand Down
8 changes: 8 additions & 0 deletions docs/api/pygal.graph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ pygal.graph.pie module
:undoc-members:
:show-inheritance:

pygal.graph.public module
-------------------------

.. automodule:: pygal.graph.public
:members:
:undoc-members:
:show-inheritance:

pygal.graph.pyramid module
--------------------------

Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Changelog
* Maps are now plugins, they are removed from pygal core and moved to packages (pygal_maps_world, pygal_maps_fr, pygal_maps_ch, ...) (#225)
* Dot now supports negative values
* Fix dot with log scale (#201)
* Fix y_labels behaviour for lines
* Fix x_labels and y_labels behaviour for xy like
* Improve gauge a bit
* Finally allow call chains on add

1.7.0
=====
Expand Down
3 changes: 2 additions & 1 deletion docs/documentation/builtin_styles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Default

.. pygal-code::

chart = pygal.StackedLine(fill=True, interpolate='cubic')
from pygal.style import DefaultStyle
chart = pygal.StackedLine(fill=True, interpolate='cubic', style=DefaultStyle) # Setting style here is not necessary
chart.add('A', [1, 3, 5, 16, 13, 3, 7])
chart.add('B', [5, 2, 3, 2, 5, 7, 17])
chart.add('C', [6, 10, 9, 7, 3, 1, 0])
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/parametric_styles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Desaturate
.. pygal-code::

from pygal.style import DesaturateStyle
desaturate_style = DesaturateStyle('#8322dd')
desaturate_style = DesaturateStyle('#8322dd', step=8)
chart = pygal.StackedLine(fill=True, interpolate='cubic', style=desaturate_style)
chart.add('A', [1, 3, 5, 16, 13, 3, 7])
chart.add('B', [5, 2, 3, 2, 5, 7, 17])
Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/sparks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Sparklines support the same options as normal charts but for those that are over

.. pygal-code:: sparkline

from pygal.style import RTDStyle
chart = pygal.Line(style=RTDStyle, interpolate='cubic')
chart = pygal.Line(interpolate='cubic')
chart.add('', [1, 3, 5, 16, 13, 3, 7])
chart.render_sparkline()

.. pygal-code:: sparkline

chart = pygal.Line()
from pygal.style import LightSolarizedStyle
chart = pygal.Line(style=LightSolarizedStyle)
chart.add('', [1, 3, 5, 16, 13, 3, 7, 9, 2, 1, 4, 9, 12, 10, 12, 16, 14, 12, 7, 2])
chart.render_sparkline(width=500, height=25, show_dots=True)

Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/types/bar.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Bar charts / Histograms
-----------------------
Bar
---

Basic
~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/types/box.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Box plot
--------
Box
---

Basic
~~~~~
Expand Down
16 changes: 14 additions & 2 deletions docs/documentation/types/dot.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Dot charts
----------
Dot
---

Basic
~~~~~
Expand All @@ -15,3 +15,15 @@ Punch card like chart:
dot_chart.add('Firefox', [7473, 8099, 11700, 2651, 6361, 1044, 3797, 9450])
dot_chart.add('Opera', [3472, 2933, 4203, 5229, 5810, 1828, 9013, 4669])
dot_chart.add('IE', [43, 41, 59, 79, 144, 136, 34, 102])


Negative
~~~~~~~~

Negative values are also supported, drawing the dot empty:

.. pygal-code:: 600 300

dot_chart = pygal.Dot(x_label_rotation=30)
dot_chart.add('Normal', [10, 50, 76, 80, 25])
dot_chart.add('With negatives', [0, -34, -29, 39, -75])
4 changes: 2 additions & 2 deletions docs/documentation/types/funnel.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Funnel charts
-------------
Funnel
------

Basic
~~~~~
Expand Down
9 changes: 4 additions & 5 deletions docs/documentation/types/gauge.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
Gauge charts
------------
Gauge
-----

Basic
~~~~~

Simple gauge chart:
Gauge chart:

.. pygal-code::
.. pygal-code:: 600 550

gauge_chart = pygal.Gauge(human_readable=True)
gauge_chart.title = 'DeltaBlue V8 benchmark results'
gauge_chart.x_labels = ['Richards', 'DeltaBlue', 'Crypto', 'RayTrace', 'EarleyBoyer', 'RegExp', 'Splay', 'NavierStokes']
gauge_chart.range = [0, 10000]
gauge_chart.add('Chrome', 8212)
gauge_chart.add('Firefox', 8099)
Expand Down
14 changes: 14 additions & 0 deletions docs/documentation/types/histogram.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Histogram
---------

Basic
~~~~~

Histogram are special bars that take 3 values for a bar: the ordinate height, the abscissa start and the abscissa end.


.. pygal-code::

hist = pygal.Histogram()
hist.add('Wide bars', [(5, 0, 10), (4, 5, 13), (2, 0, 15)])
hist.add('Narrow bars', [(10, 1, 2), (12, 4, 4.5), (8, 11, 13)])
1 change: 1 addition & 0 deletions docs/documentation/types/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pygal provides various kinds of charts:

line
bar
histogram
xy
pie
radar
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/types/line.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Line charts
-----------
Line
----

Basic
~~~~~
Expand Down
Loading

0 comments on commit 2531304

Please sign in to comment.