From fbfd1c6bda0f6ca6fe7a42a2b9979ded80e8e2ed Mon Sep 17 00:00:00 2001 From: Guillaume Thomas Date: Wed, 2 Sep 2015 23:06:19 +0200 Subject: [PATCH] Fix #25 --- README.rst | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index e0afff9..600c48d 100644 --- a/README.rst +++ b/README.rst @@ -121,29 +121,31 @@ Please read the doc for `DataFrame.plot`_. For example, with the following dataset: -:: - - A B C - ts - 2015-01-01 00:00:00 27451873 29956800 113 - 2015-01-01 01:00:00 20259882 17906600 76 - 2015-01-01 02:00:00 11592256 12311600 48 - 2015-01-01 03:00:00 11795562 11750100 50 - 2015-01-01 04:00:00 9396718 10203900 43 - 2015-01-01 05:00:00 14902826 14341100 53 .. code:: python + import pandas as pd + from pandas_highcharts.core import serialize + from pandas.compat import StringIO + dat = """ts;A;B;C + 2015-01-01 00:00:00;27451873;29956800;113 + 2015-01-01 01:00:00;20259882;17906600;76 + 2015-01-01 02:00:00;11592256;12311600;48 + 2015-01-01 03:00:00;11795562;11750100;50 + 2015-01-01 04:00:00;9396718;10203900;43 + 2015-01-01 05:00:00;14902826;14341100;53""" + df = pd.read_csv(StringIO(dat), sep=';', index_col='ts', parse_dates='ts') + # Basic line plot - chart = pandas_highcharts.serialize(df, render_to="my-chart", title="My Chart") + chart = serialize(df, render_to="my-chart", title="My Chart") # Basic column plot - chart = pandas_highcharts.serialize(df, render_to="my-chart", title="Test", kind="bar") + chart = serialize(df, render_to="my-chart", title="Test", kind="bar") # Basic column plot - chart = pandas_highcharts.serialize(df, render_to="my-chart", title="Test", kind="barh") + chart = serialize(df, render_to="my-chart", title="Test", kind="barh") # Plot C on secondary axis - chart = pandas_highcharts.serialize(df, render_to="my-chart", title="Test", secondary_y = ["C"]) + chart = serialize(df, render_to="my-chart", title="Test", secondary_y = ["C"]) # Plot on a 1000x700 div - chart = pandas_highcharts.serialize(df, render_to="my-chart", title="Test", figsize = (1000, 700)) + chart = serialize(df, render_to="my-chart", title="Test", figsize = (1000, 700)) .. _Highcharts plots: http://www.highcharts.com/ .. _pandas: https://github.com/pydata/pandas