Chart Plugin

Name Chart Plugin
Vendor Atlassian Software Systems (Website)
Authors David Peterson, Bob Swift
Homepage http://confluence.atlassian.com/display/CONFEXT/Chart+Plugin
Issue Management http://developer.atlassian.com/jira/browse/CHRT
Categories Content Macros
Version 1.9.1
Availability Confluence v2.5 to v2.9-m2-r2
State Stable
Support Atlassian Supported Plugins
License Freeware / Open Source (BSD)
Price Free
Release Docs http://confluence.atlassian.com/display/CONFEXT/Chart+Plugin
Java API Docs n/a
Download Source http://svn.atlassian.com/svn/public/contrib/confluence/chart-plugin/tags/chart-plugin-1.9.1
Download JAR chart-plugin-1.9.1.jar

Compatibility With Confluence

Plugin Version 2.4.5 2.5.8 2.6.2 2.7.3 2.8.0 Tested
1.8    
1.9    
1.9.1  


Compatibility With Confluence | Description | Installation | Simple example | Parameters | Usage Examples | Version History | Release Notes | Open Issues | Screenshots

Description

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

Installation

Confluence
version
Plugin version
shipped with Confluence
Recommended
version
Installation or update notes
2.3 1.7 1.7.1 or higher Update with Confluence Repository Client or upload
2.2.x 1.5 1.7.1 or higher Remove chart-plugin-1.x.jar from .../WEB-INF/lib
Update with Confluence Repository Client or upload
2.1.5 - 2.1.x 1.5 1.7 Remove chart-plugin-1.x.jar from .../WEB-INF/lib
Update with Confluence Repository Client or upload
1.7.1+ will not work
2.0 - 2.1.4 1.0 - 1.2 1.5 Remove chart-*.jar from .../WEB-INF/lib
Update with Confluence Repository Client or upload
1.4.x none 1.5? Install in .../WEB-INF/lib
Not tested or supported with newer plugin releases
See version 43 of this page for additional installation requirements

Simple example

{chart:type=bar|title=Fish Sold}
|| Fish Type || 2004 || 2005 ||
|| Herring | 9,500 | 8,300 |
|| Salmon | 2,900 | 4,200 |
|| Tuna | 1,500 | 1,500 |
{chart}

Parameters

Chart type parameters | Display control parameters | Title and label customization parameters | Data specification parameters | Color customization parameters | Axis customization parameters | Pie chart customization parameters | Attachment parameters
Also see the Notation guide - it contains more information on some of these parameters.

Chart type parameters

These parameters change what type of chart to display and the way the chart looks.

  • type - The type of chart to display. Both standard charts and XY charts are supported. XY charts have numerical x and y axes. The x values may optionally be time based (see the timeSeries parameter). The following chart types are available:
Standard charts
  • pie (default)
  • bar
  • line
  • area
XY plots
  • xyArea
  • xyBar
  • xyLine
  • xyStep
  • xyStepArea
  • scatter
  • timeSeries
Other charts
  • 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.
  • showShapes - Shapes will be shown at each data point in a line chart unless showShapes=false.
  • opacity - A percent value between 0 (not visible) and 100 (non-transparent) that determines how opaque the foreground areas and bars display. Defaults are:
    • 75 percent for 3D charts
    • 50 percent for non-stacked area charts
    • 100 percent for all other charts

Display control parameters

  • width - The width of the chart in pixels (default is '300')
  • height - The height of the chart in pixels (default is '300')
  • dataDisplay - Default is false to not display the rendered body of the macro (usually the data tables). When dataDisplay=true or dataDisplay=after, the data will be displayed after the chart. When dataDisplay=before, the data will be displayed before the chart.
  • imageFormat - Default is png. Format of generated image. Valid formats are png and jpg. Other formats may be also be valid if installed on your server.

Title and label customization parameters

  • title - The title of the chart.
  • subTitle - A subtitle for the chart using a smaller font.
  • xLabel - The label to use for the x (domain) axis
  • yLabel - The label to use for the y (range) axis
  • legend - A legend will be displayed unless 'legend=false' is specified.

Data specification parameters

The data for the chart is taken from tables found when the macro body is rendered. These options control how this data is interpreted. By default, numeric and date values are interpreted according to the Confluence global default language (locale) formats. If conversion fails, other languages defined to Confluence will be tried. Additional conversion options can be specified using the parameters below.

  • tables - Comma separated list of table ids and/or table numbers (starting at 1) contained within the body of the macro that will be used as the data for the chart. Defaults to all first level tables. If data tables are embedded in other tables, then table selection will be required. This occurs when more complex formatting is done (for example using section and column macros). See Macros know to cause problems
  • columns - Comma separated list of column labels and/or column titles and/or column numbers for tables used for chart data. This applies to all tables processed. Defaults to all columns. Columns are enumerated starting at 1. Column label is the text for the column in the header row. Column title is the (html) title attribute for the column in the header row.
  • dataOrientation - The data tables will be interpreted as columns (horizontally) representing domain and x values unless 'dataOrientation=vertical'.
  • timeSeries - If 'true', the x values in an XY plot will be treated as time series data and so will be converted according date formats.
  • dateFormat - For time series data, the date format allows for additional customization of the conversion of data to date values. By default, the Confluence language defined date formats will be used. If a dateFormat is specified, it will be the first format used to interpret date values. Specify a format that matches the format of the time series data. See simple date format.
  • timePeriod - Specify the time period for time series data. Default is 'Day'. This defines the granularity of how the data is interpreted. Valid values are: Day, Hour, Millisecond, Minute, Month, Quarter, Second, Week, Year.
  • language - If provided, the language and country specification will be used to create additional number and date formats to be used for data conversion. This specification will be used before the default languages automatically used. Valid values are 2 character ISO 639-1 alpha-2 codes.
  • country - Used in combination with the language parameter. Valid values are 2 character ISO 3166 codes.
  • forgive - Default is true to try to convert numeric and date values that do not totally match any of the default or user specified formats. Specify forgive=false to enforce strict data format. Data format errors will cause the chart to not be produced.

Color customization parameters

See the notation guide for details on how to specify colors.

  • bgColor - Color (default is 'white') to use as the background of the chart.
  • borderColor - Color of a border around the chart. Default is to not show a border.
  • colors - Comma separated list of colors used to customize category, sections, and series colors.

Axis customization parameters

Depending on the chart type, the range and domain axis may be customized. These values are automatically generated based on the data but can be overridden by specifying one or more more of these paramters.

  • rangeAxisLowerBound - range axis lower bound.
  • rangeAxisUpperBound - range axis upper bound
  • rangeAxisTickUnit - range axis units between axis tick marks
  • rangeAxisLabelAngle - angle for the range axis label in degrees
  • domainAxisLowerBound - domain axis lower bound. For a date axis, this value must be expressed in the date format specified by the dateFormat parameter
  • domainAxisUpperBound - domain axis upper bound. For a date axis, this value must be expressed in the date format specified by the dateFormat parameter
  • domainAxisTickUnit - domain axis units between axis tick marks. For a date axis, this value represents a count of the units specified in the timePeriod parameter. The time period unit can be overridden by specifying a trailing character: y for years, M for months, d for days, h for hours, m for minutes, s for seconds, u - milliseconds
  • domainAxisLabelAngle - angle for the domain axis label in degrees
  • categoryLabelPosition - allows axis label text position for categories to be customized
    • up45 - 45 degrees going upward
    • up90 - 90 degrees going upward
    • down45 - 45 degrees going downward
    • down90 - 90 degrees going downward
  • dateTickMarkPosition - placement of the date tick mark
    • start (default) - tick mark is at the start of the date period
    • middle - tick mark is in the middle of the date period
    • end - tick mark is at the end of the date period

Pie chart customization parameters

  • pieSectionLabel - Format for how pie section labels are displayed. The default is to show only the pie section key value. The format is a string with special replacement variables:
    • %0% is replaced by the pie section key.
    • %1% is replaced by the pie section numeric value.
    • %2% is replaced by the pie section percent value.
      Example 1: "%0% = %1%" would display something like "Independent = 20"
      Example 2: "%0% (%2%)" would display something like "Independent (20%)"
  • pieSectionExplode - Comma separated list of pie keys that are to be shown exploded. Defaults to no exploded sections. Note: requires jFreeChart version 1.0.3 or higher.

Attachment parameters

These are advanced options that can be used for chart versioning, automation enablement, and to improve performance. Use these options carefully! Normally, the chart image is regenerated each time the page is displayed. These options allow for the generated image to be saved as an attachment and have subsequent access re-use the attachment. This can be useful especially when combined with the Cache Plugin to improve performance. Depending on the options chosen, chart images can be versioned for historical purposes.

  • attachment - Chart image will be saved in a attachment. This advanced capability is for automation or use in combination with the cache macro. For attachment to be used, the user must be authorized to add attachments to the page specified.
    • ^attachmentName.png - The chart is saved as an attachment to the current page.
    • page^attachmentName.png - The chart is saved as an attachment to the page name provided.
    • space:page^attachmentName.png - The chart is saved as an attachment to the page name provided in the space indicated.
  • attachmentVersion - Defines the the versioning mechanism for saved charts.
    • new - (default) Creates new version of the attachment.
    • replace - Replaces all previous versions of the chart. To replace an existing attachment, the user must be authorized to remove attachments for the page specified.
    • keep - Only saves a new attachment if an existing export of the same name does not exist. An existing attachment will not be changed or updated.
  • attachmentComment - Comment used for a saved chart attachment.
  • thumbnail - Default is false. If true, the chart image attachment will be shown as a thumbnail.
Chart type parameters | Display control parameters | Title and label customization parameters | Data specification parameters | Color customization parameters | Axis customization parameters | Pie chart customization parameters | Attachment parameters

Usage Examples

Compatibility With Other Macros

Macros known to be allowed in the body of the chart macro
  • Include Page Macro - to include a page containing data tables
  • SQL Plugin - to generate chart data using SQL select statements, note multiple sql macros are allowed in the same body.
  • CSV Macro - to provide chart data from comma separated values (csv)
  • Java Scripting Plugin - to generate chart data using Java code
  • Excel Plugin - to provide chart data from an Excel spreadsheet
  • (outdated) Layout Macros - section and column macros can be used starting with of version 1.7

Macros known to cause problem if included in the body of the chart macro

If you use the section, column, scrollbar, or other advanced formatting macros in the body of the chart macro, then you must use the tables parameter to identify the tables that are to be used for chart data. This is due to the fact that these macros produce tables causing the data tables to be lower level sub-tables. The easiest approach is to assign an id to the data table and then explicitly list it in the tables parameter of the chart macro. The id of the table can be set using various macros that have Common table capabilities.

Version History

Version Date Author Notes
1.9.1 26-Feb-2008 Bob Swift release notes
1.8 04-Mar-2007 Bob Swift release notes - requires Confluence 2.2 and above
1.7.2 22-Jan-2007 Bob Swift release notes - requires Confluence 2.2 and above
1.7.1 16-Dec-2006 Bob Swift release notes - requires Confluence 2.2 and above
1.7 11-Dec-2006 Bob Swift release notes
1.5 27-Feb-2006 Bob Swift release notes
1.4 28-Nov-2005 Bob Swift release notes
1.3 27-Nov-2005 Bob Swift release notes
1.2 14-Nov-2005 David Peterson, Bob Swift release notes
1.1 09-Nov-2005 David Peterson rename macro to chart, updated help
1.0 05-Nov-2005 David Peterson Initial release

Release Notes

Open Issues

Atlassian Developer Network JIRA (25 issues)
T Key Summary Reporter Assignee Pr Status
Bug CHRT-3 Allow configuration via an XWork plugin David Peterson David Peterson Major Open
New Feature CHRT-11 Support multiple axes, multiple dataset plots Bob Swift Bob Swift Major Open
Bug CHRT-14 Charts don't show up in emails Bob Swift Bob Swift Major Open
New Feature CHRT-19 Add support for combined charts Bob Swift Bob Swift Major Open
Bug CHRT-27 chart macro, sql macro - bad legend and data point Doug Tung Bob Swift Major Open
New Feature CHRT-53 Add color customization to Gantt charts Stephen Day Bob Swift Major Open
New Feature CHRT-54 Support dashed lines in charts Alex Chapman Bob Swift Major Open
Bug CHRT-55 Scaffolding data in first row is not displayed Gabor Maghera Bob Swift Major Open
Bug CHRT-56 1.0.7 jfree chart and jfree-common 1.0.12 jars, not compatible with usage plugin Gurleen Anand Bob Swift Major Open
New Feature CHRT-60 Limit Data Rows John Martin Bob Swift Major Open
New Feature CHRT-61 Multiple Pies When Stacked John Martin Bob Swift Minor Open
New Feature CHRT-62 Add Pivot Option John Martin Bob Swift Minor Open
New Feature CHRT-63 Allow charts to have rolling averages Scott Farquhar Bob Swift Major Open
Improvement CHRT-64 Defined Column Selection for Gantt John Martin Bob Swift Major Open
New Feature CHRT-65 Milestone Marker for Zero Length Data John Martin Bob Swift Major Open
Bug CHRT-66 Vertically oriented line graphs have leading and/or trailing zeroes David Chui Unassigned Major Open
Bug CHRT-67 Gantt chart seems to miss first row in a Scaffolding plug-in generated table Jim Dibble Bob Swift Minor Open
Bug CHRT-68 Download of generated chart fails if username case is incorret Ingomar Otter Bob Swift Minor Open
Bug CHRT-70 Color "green" results in Java green rather than Web green Don Willis Bob Swift Minor Open
New Feature CHRT-71 Allow logarithmic scale in axes Cagatay Kavukcuoglu Bob Swift Major Open
New Feature CHRT-72 Add ability to annotate a chart Jeff Schnitter Bob Swift Major Open
New Feature CHRT-73 Ability to exclude columns with zero values in pie chart Paul J Smith Bob Swift Major In Progress
Bug CHRT-74 Generated horizontal bar chart image crops last label Gavin McKenzie Bob Swift Major