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__cumulative_flow.rst | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 doc/tile__cumulative_flow.rst (limited to 'doc/tile__cumulative_flow.rst') diff --git a/doc/tile__cumulative_flow.rst b/doc/tile__cumulative_flow.rst new file mode 100644 index 0000000..c26d46a --- /dev/null +++ b/doc/tile__cumulative_flow.rst @@ -0,0 +1,68 @@ +=================== +``cumulative_flow`` +=================== + +.. image:: img/smaller/cumulative-flow.png + +**Description** + +Cumulative chart using `jqPlot `_ library. Allows to +display up to seven plots on a single chart. + +**Content** + +:: + + data = { + "title": "", + "series_list": [{"label": "<label1>", "series": [<val1>, <val2>, ...]}, + {"label": "<label2>", "series": [<val1>, <val2>, ...]}] + } + +where: + +.. describe:: title + + Title to be displayed above the labels. + +.. describe:: series_list + + A container (i.e. list of objects) for the data; each such object + corresponding to a single plot consists of two keys: ``label`` and + ``series``, where the latter is a list of values constructing the plot. + +Example:: + + curl http://localhost:7272/api/v0.1/<api_key>/push + -X POST + -d "tile=cumulative_flow" + -d "key=<tile_id>" + -d 'data={"title": "My title:", + "series_list": [{"label": "label 1", "series": [ 0, 0, 0, 0, 1, 1, 2, 2, 1, 1, 1, 0, 0, 2, 0 ]}, + {"label": "label 2", "series": [ 0, 5, 0, 0, 1, 0, 0, 3, 0, 0, 0, 7, 8, 9, 1 ]}]}' + +**Configuration** + +:: + + value = {"ticks": [[<key>, "<value>"], [<key>, "<value>"], ... ]} + +where: + +.. describe:: ticks + + List of elements defining x-axis; each such element is a list of form ``[k, + v]`` where ``k`` is an oridinal number designating position of such tick and + ``v`` is a string which will be displayed in that place. + +Example:: + + curl http://localhost:7272/api/v0.1/<api_key>/tileconfig/<tile_id> + -X POST + -d 'value={"ticks": [[1, "mon"], [2, "tue"], [3, "wed"], [4, "thu"], [5, "fri"], [6, "sat"], [7, "sun"]]}' + +.. note:: + + If ``series_list`` contains more than one object (which is the case 99% of + the time), each one of them should have ``series`` list of the same length - + and this lenght should be equal to the number of ``ticks``. -- cgit v1.2.3