From b5e8833ab19cb1066eb1a5be93874d1833ec6b44 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Wed, 13 Jan 2016 10:35:33 +0100 Subject: [PATCH] Add doc for ci and print value positioning --- demo/moulinrouge/tests.py | 1 - docs/api/pygal.rst | 1 + docs/api/pygal.stats.rst | 7 +++++++ docs/changelog.rst | 6 +++--- docs/documentation/configuration/data.rst | 22 +++++++++++++++++++--- docs/documentation/configuration/value.rst | 16 ++++++++++++++++ 6 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 docs/api/pygal.stats.rst diff --git a/demo/moulinrouge/tests.py b/demo/moulinrouge/tests.py index 6b95b9f..3bc6d0c 100644 --- a/demo/moulinrouge/tests.py +++ b/demo/moulinrouge/tests.py @@ -1040,7 +1040,6 @@ def get_test_routes(app): @app.route('/test/ci/') def test_ci_for(chart): chart = CHARTS_BY_NAME[chart]( - confidence_interval_proportion=True, style=styles['default']( value_font_family='googlefont:Raleway', value_colors=(None, None, 'blue', 'red', 'green'), diff --git a/docs/api/pygal.rst b/docs/api/pygal.rst index 3450259..57364a0 100644 --- a/docs/api/pygal.rst +++ b/docs/api/pygal.rst @@ -27,6 +27,7 @@ Submodules pygal.interpolate pygal.serie pygal.state + pygal.stats pygal.style pygal.svg pygal.table diff --git a/docs/api/pygal.stats.rst b/docs/api/pygal.stats.rst new file mode 100644 index 0000000..9cf07d8 --- /dev/null +++ b/docs/api/pygal.stats.rst @@ -0,0 +1,7 @@ +pygal.stats module +================== + +.. automodule:: pygal.stats + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/changelog.rst b/docs/changelog.rst index 3225b38..776fd8c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,11 +2,11 @@ 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) -* Confidence intervals (thanks @chartique #292) +* Bar print value positioning with `print_values_position`. Can be `top`, `center` or `bottom` (thanks @chartique #291) `doc `_ +* Confidence intervals (thanks @chartique #292) `doc `_ 2.0.12 diff --git a/docs/documentation/configuration/data.rst b/docs/documentation/configuration/data.rst index 04ec317..2488aee 100644 --- a/docs/documentation/configuration/data.rst +++ b/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_size=30, value_colors=('white',))) - chart.add('line', [0, 12, 31, 8, 28, 0]) + chart.add('line', [0, 12, 31, 8, -28, 0]) dynamic_print_values -------------------- @@ -51,7 +51,23 @@ Show print_values only on legend hover. value_font_family='googlefont:Raleway', value_font_size=30, 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 @@ -62,7 +78,7 @@ zero values are shown by default but you can use this option to hide them. .. pygal-code:: 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 diff --git a/docs/documentation/configuration/value.rst b/docs/documentation/configuration/value.rst index 426f0ef..6f8a162 100644 --- a/docs/documentation/configuration/value.rst +++ b/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', '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}}])