Skip to content

Commit

Permalink
Added documentation for chart examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Apr 25, 2013
1 parent 9a44ab3 commit 611b42a
Show file tree
Hide file tree
Showing 53 changed files with 372 additions and 40 deletions.
Binary file added dev/docs/source/_static/chart_area1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_area2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_area3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_bar1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_bar2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_bar3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_column1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_column2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_column3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_table1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_table2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_tools1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_tools2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_tools3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_tools4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_tools5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_data_tools6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_line1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_pie1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_pie2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_radar1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_radar2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_radar3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_scatter1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_scatter2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/docs/source/_static/chart_scatter3.png
Binary file added dev/docs/source/_static/chart_scatter4.png
Binary file added dev/docs/source/_static/chart_scatter5.png
Binary file added dev/docs/source/_static/chart_secondary_axis1.png
Binary file added dev/docs/source/_static/chart_stock1.png
23 changes: 23 additions & 0 deletions dev/docs/source/chart_examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Chart Examples
==============

The following are some of the examples included in the
`examples <https://github.com/jmcnamara/XlsxWriter/tree/master/examples>`_
directory of the XlsxWriter distribution.

.. toctree::
:maxdepth: 1

example_chart_simple.rst
example_chart_area.rst
example_chart_bar.rst
example_chart_column.rst
example_chart_line.rst
example_chart_pie.rst
example_chart_scatter.rst
example_chart_radar.rst
example_chart_stock.rst
example_chart_secondary_axis.rst
example_chart_data_table.rst
example_chart_data_tools.rst

1 change: 1 addition & 0 deletions dev/docs/source/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Contents
working_with_outlines.rst
working_with_memory.rst
examples.rst
chart_examples.rst
excel_writer_xlsx.rst
alternatives.rst
bugs.rst
Expand Down
23 changes: 23 additions & 0 deletions dev/docs/source/example_chart_area.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _ex_chart_area:

Example: Area Chart
===================

Example of creating Excel Area charts.

Chart 1 in the following example is a default area chart:

.. image:: _static/chart_area1.png
:scale: 75 %

Chart 2 is a stacked area chart:

.. image:: _static/chart_area2.png
:scale: 75 %

Chart 3 is a percentage stacked area chart:

.. image:: _static/chart_area3.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_area.py
23 changes: 23 additions & 0 deletions dev/docs/source/example_chart_bar.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _ex_chart_bar:

Example: Bar Chart
==================

Example of creating Excel Bar charts.

Chart 1 in the following example is a default bar chart:

.. image:: _static/chart_bar1.png
:scale: 75 %

Chart 2 is a stacked bar chart:

.. image:: _static/chart_bar2.png
:scale: 75 %

Chart 3 is a percentage stacked bar chart:

.. image:: _static/chart_bar3.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_bar.py
23 changes: 23 additions & 0 deletions dev/docs/source/example_chart_column.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _ex_chart_column:

Example: Column Chart
=====================

Example of creating Excel Column charts.

Chart 1 in the following example is a default column chart:

.. image:: _static/chart_column1.png
:scale: 75 %

Chart 2 is a stacked column chart:

.. image:: _static/chart_column2.png
:scale: 75 %

Chart 3 is a percentage stacked column chart:

.. image:: _static/chart_column3.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_column.py
18 changes: 18 additions & 0 deletions dev/docs/source/example_chart_data_table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _ex_chart_data_table:

Example: Charts with Data Tables
================================

Example of creating charts with data tables.

Chart 1 in the following example is a column chart with default data table:

.. image:: _static/chart_data_table1.png
:scale: 75 %

Chart 2 is a column chart with default data table with legend keys:

.. image:: _static/chart_data_table2.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_data_table.py
40 changes: 40 additions & 0 deletions dev/docs/source/example_chart_data_tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. _ex_chart_data_tools:

Example: Charts with Data Tools
===============================

A demo of an various Excel chart data tools that are available via an
XlsxWriter chart. These include, Trendlines, Data Labels, Error Bars, Drop
Lines, High-Low Lines and Up-Down Bars.

Chart 1 in the following example is a chart with trendlines:

.. image:: _static/chart_data_tools1.png
:scale: 75 %

Chart 2 is a chart with data labels and markers:

.. image:: _static/chart_data_tools2.png
:scale: 75 %

Chart 3 is a chart with error bars:

.. image:: _static/chart_data_tools3.png
:scale: 75 %

Chart 4 is a chart with up-down bars:

.. image:: _static/chart_data_tools4.png
:scale: 75 %

Chart 5 is a chart with hi-low lines:

.. image:: _static/chart_data_tools5.png
:scale: 75 %

Chart 6 is a chart with drop lines:

.. image:: _static/chart_data_tools6.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_data_tools.py
15 changes: 15 additions & 0 deletions dev/docs/source/example_chart_line.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _ex_chart_line:

Example: Line Chart
===================

Example of creating an Excel line chart. The X axis of a line chart is a
category axis with fixed point spacing. For a line chart with arbitrary point
spacing see the Scatter chart type.

Chart 1 in the following example is:

.. image:: _static/chart_line1.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_line.py
23 changes: 23 additions & 0 deletions dev/docs/source/example_chart_pie.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _ex_chart_pie:

Example: Pie Chart
==================

Example of creating Excel Column charts.

Chart 1 in the following example is:

.. image:: _static/chart_pie1.png
:scale: 75 %

Chart 2 shows how to set segment colours.

It is possible to define chart colours for most types of XlsxWriter charts via
the :func:`add_series()` method. However, Pie charts are a special case since
each segment is represented as a point and as such it is necessary to assign
formatting to each point in the series.

.. image:: _static/chart_pie2.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_pie.py
24 changes: 24 additions & 0 deletions dev/docs/source/example_chart_radar.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _ex_chart_radar:

Example: Radar Chart
====================

Example of creating Excel Column charts.

Chart 1 in the following example is a default radar chart:

.. image:: _static/chart_radar1.png
:scale: 75 %

Chart 2 in the following example is a radar chart with markers:

.. image:: _static/chart_radar2.png
:scale: 75 %

Chart 3 in the following example is a filled radar chart:

.. image:: _static/chart_radar3.png
:scale: 75 %


.. literalinclude:: ../../../examples/chart_radar.py
34 changes: 34 additions & 0 deletions dev/docs/source/example_chart_scatter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _ex_chart_scatter:

Example: Scatter Chart
======================

Example of creating Excel Scatter charts.

Chart 1 in the following example is a default scatter chart:

.. image:: _static/chart_scatter1.png
:scale: 75 %

Chart 2 is a scatter chart with straight lines and markers:

.. image:: _static/chart_scatter2.png
:scale: 75 %

Chart 3 is a scatter chart with straight lines and no markers:

.. image:: _static/chart_scatter3.png
:scale: 75 %

Chart 4 is a scatter chart with smooth lines and markers:

.. image:: _static/chart_scatter4.png
:scale: 75 %

Chart 5 is a scatter chart with smooth lines and no markers:

.. image:: _static/chart_scatter5.png
:scale: 75 %


.. literalinclude:: ../../../examples/chart_scatter.py
12 changes: 12 additions & 0 deletions dev/docs/source/example_chart_secondary_axis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _ex_chart_secondary_axis:

Example: Secondary Axis Chart
=============================

Example of creating an Excel Line chart with a secondary axis. Note, the
primary and secondary chart type must be the same.

.. image:: _static/chart_secondary_axis1.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_secondary_axis.py
13 changes: 13 additions & 0 deletions dev/docs/source/example_chart_simple.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _ex_chart_simple:

Example: Chart (Simple)
=======================

Example of a simple column chart with 3 data series.

The output from example 1 is:

.. image:: _static/chart_simple.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart.py
13 changes: 13 additions & 0 deletions dev/docs/source/example_chart_stock.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _ex_chart_stock:

Example: Stock Chart
====================

Example of creating and Excel HiLow-Close Stock chart.

Chart 1 in the following example is:

.. image:: _static/chart_stock1.png
:scale: 75 %

.. literalinclude:: ../../../examples/chart_stock.py
5 changes: 5 additions & 0 deletions dev/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ XlsxWriter supports the following features in version |version|:

examples.rst

.. toctree::
:maxdepth: 1

chart_examples.rst

.. toctree::
:maxdepth: 1

Expand Down
10 changes: 8 additions & 2 deletions dev/docs/source/workbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ See the :ref:`format` and :ref:`working_with_formats` sections for more details
about Format properties and how to set them.


workbook.add_format()
---------------------
workbook.add_chart()
--------------------

.. py:function:: add_chart()
Create a chart object that can be added to a worksheet.

TODO.



workbook.close()
----------------

Expand Down
Loading

0 comments on commit 611b42a

Please sign in to comment.