Skip to content

Commit

Permalink
Fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
gtnx committed Sep 2, 2015
1 parent 3938e94 commit fbfd1c6
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions README.rst
Expand Up @@ -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
Expand Down

0 comments on commit fbfd1c6

Please sign in to comment.