{excerpt}
A plugin for generating simple charts from tabular data
{excerpt}
|| Name | Chart Plugin ||
|| Status | {color:red}Beta{color} ||
|| Version | 1.2 ||
|| Product Versions | Confluence 1.4\+ ||
|| Author(s) | [Tom Davies|~tom@atlassian.com], [David Peterson|~david@randombits.org], [Bob Swift|~bob.swift@lakeviewtech.com] ||
|| Price | {color:green}Free{color} ||
|| Homepage | [Chart Plugin] ||
|| Issue Tracking | [http://developer.atlassian.com/jira/browse/CHRT] ||
|| JavaDocs | [http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/trunk/target/docs/apidocs/] ||
|| Download JAR | [chart-plugin-1.2.jar|http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/jars/chart-plugin-1.1.jar], [all versions|http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/jars/] ||
|| Download Source | [http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/] ||

h4. Description/Features
A plugin that will allow you to generate simple charts from tabular data.

h4. Requirements
{note}
These library files are already installed in Confluence 2.0
{note}
# [jcommon-1.0.0-rc1.jar|http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/trunk/lib/jcommon-1.0.0-rc1.jar] (copy to your lib directory)
# [jfreechart-1.0.0-rc1.jar|http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/trunk/lib/jfreechart-1.0.0-rc1.jar] (copy to your lib directory)

h4. Installation
# If necessary, copy the library jars into Confluence's WEB-INF/lib: jcommon-1.0.0-rc1.jar,jfreechart-1.0.0-rc1.jar
# Restart Confluence
# Install the plugin jar using the admin interface
# You're done\!

h4. Documentation
{noformat}
{chart:title=Fish Sold}
|| Fish Type || 2004 || 2005 ||
|| Herring | 9,500 | 8,300 |
|| Salmon | 2,900 | 4,200 |
|| Tuna | 1,500 | 1,500 |
{chart}
{noformat}
* *type* \- The type of chart to display. May be:
** *pie* \- A pie chart (default)
** *bar* \- A bar chart
** *line* \- A line chart
** *area* \- An area chart
* *title* \- The title of the chart.
* *xLabel* \- The label to use for the x axis.
* *yLabel* \- The label to use for the y axis.
* *legend* \- A legend will be displayed unless 'legend=false' is specified.
* *orientation* \- A bar, line, or area chart will be displayed vertically (y axis is vertical) unless 'orientation=horizontal' is specified.
* *3D* \- A pie, bar, or line chart will be shown in 3D if '3D=true' is specified.
* *stacked* \- A bar or area chart will be shown with stacked values if 'stacked=true' is specified.
* *width* \- The width of the chart in pixels (default is '300')
* *height* \- The height of the chart in pixels (default is '300')
* *dataDisplay* \- If 'true', the data table will be displayed below the chart.
* *dataOrientation* \- The data table will be interpreted as columns (horizontally) representing domain and x values unless 'dataOrientation=vertical'.

h4. Usage Examples
h5. Simple Pie Chart
!pie.png|thumbnail!
{noformat}
{chart}
|| || Democrat || Republican || Independent ||
|| Mascots | 40 | 40 | 20 |
{chart}
{noformat}

h5. Simple Bar Chart
!bar.png|thumbnail!
{noformat}
{chart:title=Temperatures in Brisbane|type=bar|width=400|height=350|legend=true}
|| || January || February || March || April ||
|| Max | 37.5 | 32.7 | 28.0 | 25.3 |
|| Min | 31.3 | 26.8 | 25.1 | 18.7 |
{chart}
{noformat}

h5. Simple Line Chart
!line.png|thumbnail!
{noformat}
{chart:title=Temperatures in Brisbane|type=line|width=500|height=300|legend=true}
|| || January || February || March || April ||
|| Max | 37.5 | 32.7 | 28.0 | 25.3 |
|| Min | 31.3 | 26.8 | 25.1 | 18.7 |
{chart}
{noformat}

h5. Advanced 3D Bar Chart
!Rochester_Temperatures.png|thumbnail!
{noformat}
{chart:type=bar|3d=true|title=Temperatures in Rochester Minnesota|dataDisplay=true|width=1000|height=500|legend=true|yLabel=Fahrenheit|dataOrientation=vertical}
|| Month || Max\\Temperature ||	Min\\Temperature || Average\\Temperature ||
| January 	| 25.5 | 	6.3 	| 15.9 |
| February 	| 32.4 | 	12.8 	| 22.6 |
| March 	| 44.6 | 	24.5 	| 34.6 |
| April 	| 59.7 | 	37.1 	| 48.4 |
| May 	        | 72.5 | 	48.7 	| 60.6 |
| June 	        | 81.3 | 	57.9 	| 69.6 |
| July 	        | 85.2 | 	62.8 	| 74   |
| August 	| 82.5 | 	60.7 	| 71.6 |
| September 	| 73.7 | 	51.7 	| 62.7 |
| October 	| 61.1 | 	40.1 	| 50.6 |
| November 	| 43.6 | 	27.4 	| 35.5 |
| December 	| 29.9 | 	13.6 	| 21.8 |
{chart}
{noformat}

h5. Advanced Line Chart Using SQL Data
{noformat}
{chart:title=Confluence Activity By Month|type=line|dataDisplay=true|width=1100|height=400|legend=true|dataOrientation=vertical|ylabel=Count}
{sql:jndi=ConfluenceDS|output=wiki}
select substring(lastmoddate from 1 for 7) as Month, count(distinct CONTENT.title) "Pages created", count(CONTENT.title) "Updates made" from CONTENT GROUP BY substring(lastmoddate from 1 for 7)
{sql}
{chart}
{noformat}
{note:title=Using SQL data}
Requires that the [sql macro] be installed and the jndi name matches a datasource in your server.
You will need to upgrade this macro to version 1.0.3 or above for it to work correctly within the chart macro.
{note}

h4. Version History
|| Version || Comments ||
| 1.0 | * Initial import |
| 1.1 | * Completed renaming of the macro to \{chart\}
* Updated the macro help to contain useful and accurate information.
* Fixed a bug with empty cells causing an exception. |
| 1.2 | * Added area chart type.
* Labels for the axes
* Support 3D, stacked, and vertically oriented chart attributes
* Add area chart type
* Allow data to be oriented either horizontally or vertically
* Rename 'displayData' to 'dataDisplay' for consistency with 'dataOrientation' |

h4. Screenshots
{gallery:title=Screenshots|columns=3}{gallery}