Browse Source

Add doc for ci and print value positioning

pull/296/head 2.0.13
Florian Mounier 9 years ago
parent
commit
b5e8833ab1
  1. 1
      demo/moulinrouge/tests.py
  2. 1
      docs/api/pygal.rst
  3. 7
      docs/api/pygal.stats.rst
  4. 6
      docs/changelog.rst
  5. 22
      docs/documentation/configuration/data.rst
  6. 16
      docs/documentation/configuration/value.rst

1
demo/moulinrouge/tests.py

@ -1040,7 +1040,6 @@ def get_test_routes(app):
@app.route('/test/ci/<chart>') @app.route('/test/ci/<chart>')
def test_ci_for(chart): def test_ci_for(chart):
chart = CHARTS_BY_NAME[chart]( chart = CHARTS_BY_NAME[chart](
confidence_interval_proportion=True,
style=styles['default']( style=styles['default'](
value_font_family='googlefont:Raleway', value_font_family='googlefont:Raleway',
value_colors=(None, None, 'blue', 'red', 'green'), value_colors=(None, None, 'blue', 'red', 'green'),

1
docs/api/pygal.rst

@ -27,6 +27,7 @@ Submodules
pygal.interpolate pygal.interpolate
pygal.serie pygal.serie
pygal.state pygal.state
pygal.stats
pygal.style pygal.style
pygal.svg pygal.svg
pygal.table pygal.table

7
docs/api/pygal.stats.rst

@ -0,0 +1,7 @@
pygal.stats module
==================
.. automodule:: pygal.stats
:members:
:undoc-members:
:show-inheritance:

6
docs/changelog.rst

@ -2,11 +2,11 @@
Changelog Changelog
========= =========
2.0.13 UNRELEASED 2.0.13
====== ======
* Bar print value positioning with `print_values_position`. Can be `top`, `center` or `bottom` (thanks @chartique #291) * Bar print value positioning with `print_values_position`. Can be `top`, `center` or `bottom` (thanks @chartique #291) `doc <documentation/configuration/value.html#confidence-intervals>`_
* Confidence intervals (thanks @chartique #292) * Confidence intervals (thanks @chartique #292) `doc <documentation/configuration/data.html#print-values-position>`_
2.0.12 2.0.12

22
docs/documentation/configuration/data.rst

@ -37,7 +37,7 @@ When using pygal to display static charts for printing for example you can chose
value_font_family='googlefont:Raleway', value_font_family='googlefont:Raleway',
value_font_size=30, value_font_size=30,
value_colors=('white',))) value_colors=('white',)))
chart.add('line', [0, 12, 31, 8, 28, 0]) chart.add('line', [0, 12, 31, 8, -28, 0])
dynamic_print_values dynamic_print_values
-------------------- --------------------
@ -51,7 +51,23 @@ Show print_values only on legend hover.
value_font_family='googlefont:Raleway', value_font_family='googlefont:Raleway',
value_font_size=30, value_font_size=30,
value_colors=('white',))) value_colors=('white',)))
chart.add('line', [0, 12, 31, 8, 28, 0]) chart.add('line', [0, 12, 31, 8, -28, 0])
print_values_position
---------------------
Change print value position (in bar charts only).
.. pygal-code::
chart = pygal.Bar(print_values=True, print_values_position='top')
chart.add('line', [0, 12, 31, 8, -28, 0])
.. pygal-code::
chart = pygal.Bar(print_values=True, print_values_position='bottom')
chart.add('line', [0, 12, 31, 8, -28, 0])
print_zeroes print_zeroes
@ -62,7 +78,7 @@ zero values are shown by default but you can use this option to hide them.
.. pygal-code:: .. pygal-code::
chart = pygal.Bar(print_values=True, print_zeroes=False) chart = pygal.Bar(print_values=True, print_zeroes=False)
chart.add('line', [0, 12, 31, 8, 28, 0]) chart.add('line', [0, 12, 31, 8, -28, 0])
print_labels print_labels

16
docs/documentation/configuration/value.rst

@ -203,3 +203,19 @@ Finally legends can be link with the same mechanism:
'href': 'http://en.wikipedia.org/wiki/Fifth', 'href': 'http://en.wikipedia.org/wiki/Fifth',
'target': '_self'} 'target': '_self'}
}]) }])
Confidence Intervals
~~~~~~~~~~~~~~~~~~~~
.. pygal-code::
chart = pygal.Bar(style=pygal.style.styles['default'](ci_colors=(
'black', 'blue')))
chart.add('First', [{'value': 2, 'ci': {
'type': 'continuous', 'sample_size': 50, 'stddev': .5, 'confidence': .95}}])
chart.add('Second', [{'value': 4, 'ci': {'low': 2, 'high': 5}}])
chart.add('Third', 7)
chart.add('Fourth', [{'value': 5}])
chart.add('Fifth', [{'value': 3, 'ci': {
'type': 'dichotomous', 'sample_size': 1000}}])

Loading…
Cancel
Save