Chart documentation page

A plugin for generating simple charts from tabular data

Name Chart Plugin
Status Beta
Version 1.1
Product Versions Confluence 1.4+
Author(s) [~tom@atlassian.com]Tom Davies, [~david@randombits.org]David Peterson
Price Free
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.1.jar, all versions
Download Source http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/

Description/Features

A plugin that will allow you to generate simple charts from tabular data.

Requirements

These library files are already installed in Confluence 2.0

  1. jcommon-1.0.0-rc1.jar (copy to your lib directory)
  2. jfreechart-1.0.0-rc1.jar (copy to your lib directory)

Installation

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

Documentation

{chart:title=Fish Sold}
|| Fish Type || 2004 || 2005 ||
|| Herring | 9,500 | 8,300 |
|| Salmon | 2,900 | 4,200 |
|| Tuna | 1,500 | 1,500 |
{chart}
  • 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')
  • displayData - 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'.

Usage Examples

Simple Pie Chart

Unable to render embedded object: File (pie.png) not found.

{chart}
|| || Democrat || Republican || Independent ||
|| Mascots | 40 | 40 | 20 |
{chart}
Simple Bar Chart

Unable to render embedded object: File (bar.png) not found.

{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}
Simple Line Chart

Unable to render embedded object: File (line.png) not found.

{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}
Advanced 3D Bar Chart

Unable to render embedded object: File (Rochester_Temperatures.png) not found.

{chart:type=bar|3d=true|title=Temperatures in Rochester Minnesota|displayData=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}
Advanced Line Chart Using SQL Data

Unable to render embedded object: File (Confluence_activity_by_month.gif) not found.

{chart:title=Confluence Activity By Month|type=line|displayData=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} 
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.

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.
  • Support 3D, stacked, and vertically oriented charts.
  • Support labeling of axis.
  • Support dataOrientation parameter allowing either row or column data to represent domain and x values.

Screenshots

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.