From 60c073a6ed451cf91d9877a3305407756b9ffdce Mon Sep 17 00:00:00 2001 From: Tomasz Mieszkowski Date: Thu, 28 Aug 2014 08:54:15 +0200 Subject: Tipboard got open-sourced! --- doc/tile__pie_chart.rst | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 doc/tile__pie_chart.rst (limited to 'doc/tile__pie_chart.rst') 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 `_ library, with +optional legend. + +**Content** + +:: + + data = { + "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//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 = {} + +where: + +.. describe:: jqplot_config + + Configuration params in the form described by `jqPlot documentation + `_. + +Example:: + + curl http://localhost:7272/api/v0.1//tileconfig/ + -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. -- cgit v1.2.3