diff options
author | Tomasz Mieszkowski <tomasz.mieszkowski@ext.allegro.pl> | 2014-08-28 08:54:15 +0200 |
---|---|---|
committer | Tomasz Mieszkowski <tomasz.mieszkowski@ext.allegro.pl> | 2014-08-28 08:54:15 +0200 |
commit | 60c073a6ed451cf91d9877a3305407756b9ffdce (patch) | |
tree | 955542ec282745e31d78d1b2b9515d8cebe67e78 /doc/tile__pie_chart.rst | |
download | tipboard-60c073a6ed451cf91d9877a3305407756b9ffdce.tar.gz tipboard-60c073a6ed451cf91d9877a3305407756b9ffdce.tar.bz2 tipboard-60c073a6ed451cf91d9877a3305407756b9ffdce.zip |
Tipboard got open-sourced!1.4.0
Diffstat (limited to 'doc/tile__pie_chart.rst')
-rw-r--r-- | doc/tile__pie_chart.rst | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/doc/tile__pie_chart.rst b/doc/tile__pie_chart.rst new file mode 100644 index 0000000..afd8f84 --- /dev/null +++ b/doc/tile__pie_chart.rst @@ -0,0 +1,64 @@ +============= +``pie_chart`` +============= + +.. image:: img/smaller/pie-chart.png + +**Description** + +"Pie-chart" style chart using `jqPlot <http://www.jqplot.com/>`_ library, with +optional legend. + +**Content** + +:: + + data = { + "title": "<optional_title>", + "pie_data": [[identifier1, value1], [identifier2, value2], ...] + } + +where: + +.. describe:: title + + Chart's title (optional). + +.. describe:: pie_data + + Data for pie-chart in a form of list of lists, where each sub-list is an + identifier-value pair. Percentage of the whole chart shared by given part is + calculated automatically by jqPlot - relatively to the sum of values of all + parts. + +Example:: + + curl http//localhost:7272/api/v0.1/<api_key>/push + -X POST + -d "tile=pie_chart" + -d "key=example_pie" + -d 'data={"title": "My title", "pie_data": [["Pie 1", 25], ["Pie 2", 25], ["Pie 3", 50]]}' + +-- this will result in a pie-chart with title "My title", divided by three +parts "Pie 1", "Pie 2" and "Pie 3". + +**Configuration** + +:: + + value = {<jqplot_config>} + +where: + +.. describe:: jqplot_config + + Configuration params in the form described by `jqPlot documentation + <http://www.jqplot.com/tests/pie-donut-charts.php>`_. + +Example:: + + curl http://localhost:7272/api/v0.1/<api_key>/tileconfig/<tild_id> + -X POST + -d 'value={"title": true, "legend": {"show": true, "location": "s"}}' + +-- this will result in a pie-chart with legend turned on at the bottom of the tile (``s`` stands for "south") - its title will be turned on as well. |