The Chart macro allows you to display a chart based on tabular data. When you add the macro to a page, you:
Screenshots: A table of data in the Chart macro placeholder, and the resulting chart image.
|
Using the Chart Macro
To add the Chart macro to a page:
- When editing the page, use autocomplete to add the Chart macro to the page. (Type '{' then begin typing the name of the macro, and choose it from the list of suggestions.)
- Enter your chart data as one or more tables in the body of the macro placeholder (see the screenshot above)
- Edit the macro and select a chart type using the Type parameter (see below).
- Make other parameter settings, in the Macro Browser, as described below.
- Click Preview to check that the chart appears as you expect.
- Finally, click Save to add the chart to your page.
Parameters
Chart Type Parameters
These parameters determine the type of chart to display and the way the chart looks.
| Parameter | Default | Description |
|---|---|---|
| Type | pie | The type of chart to display. XY charts have numerical x- and y-axes. The x values may optionally be time-based (see the Time Series parameter). Standard — pie, bar, line, area XY Plots — xyArea, xyBar, xyLine, xyStep, xyStepArea, scatter, timeSeries Other — gantt (beta) |
| Display Orientation | vertical | Applies to area, bar and line charts.
|
| Show in 3D | false | Applies to area, bar and line charts. |
| Stacked Values | false | Applies to area and bar charts. |
| Show shapes | true | Applies to line charts. Shapes are shown at each data point. |
| Opacity |
| A percentage value between 0 (transparent) and 100 (opaque) that determines how opaque the foreground areas and bars are. |
Display Control Parameters
| Parameter | Default | Description |
|---|---|---|
| Width | 300 | The width of the chart in pixels. |
| Height | 300 | The height of the chart in pixels. |
| Display rendered data | false | Sets whether to display the rendered body of the macro (usually the data tables). By default, the chart data table isn't rendered.
|
| Image format | png | The image format to be used for the chart.
|
Title and Label Parameters
| Parameter | Default | Description |
|---|---|---|
| Chart Title | none | The title of the chart. |
| Chart Subtitle | none | A subtitle for the chart, using a smaller font than for Title. |
| Horizontal-axis Label | none | The label for the x-axis (domain). |
| Vertical-axis Label | none | The label for the y-axis (range). |
| Show Legend | true | Show a legend or key. |
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 in Confluence will be tried. Additional conversion options can be specified using the parameters below.
| Parameter | Default | Description |
|---|---|---|
| Tables | all first level 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. 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). |
| Columns | all 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. 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. |
| Content Orientation | horizontal |
|
| Time Series | false |
|
| Date format | Confluence language defined date formats | For time series data, the date format allows for additional customization of the conversion of data to date values. If a Date format is specified, it will be the first format used to interpret date values. Specify a format that matches the time series data. See simple date format. |
| Time Period | Day | The time period for time series data. Defines the granularity of how the data is interpreted. Valid values are: Millisecond, Second, Minute, Hour, Day, Week, Month, Quarter, Year. |
| Language | none | Use in combination with the Country parameter to form a locale. These additional number and date formats will be used for data conversion before the default languages. Valid values are 2 character ISO 639-1 alpha-2 codes. |
| Country | none | Use in combination with the Language parameter to form a locale. Valid values are 2 character ISO 3166 codes. |
| Forgive | true |
|
Colour Parameters
Colours are specified using hexadecimal notation or HTML colour names.
| Parameter | Default | Description |
|---|---|---|
| Background Colour | White | Background of the chart. |
| Border Colour | no border | Border around the chart. |
| Colours | Comma-separated list of colours used to customise category, sections, and series colours. |
Axis Parameters
Depending on the chart type, the range and domain axis may be customised. These values are automatically generated based on the data but can be overridden by specifying one or more more of these parameters.
| Parameter | Default | Description |
|---|---|---|
| Range Minimum Value | none | Range axis lower bound. |
| Range Maximum Value | none | Range axis upper bound. |
| Range Axis Tick Unit | none | Range axis units between axis tick marks. |
| Range Axis Label Angle | none | Angle for the range axis label in degrees. |
| Domain Axis Lower Bound | none | Only applies to XY plots. Domain axis lower bound. For a date axis, this value must be expressed in the date format specified by the Date format parameter. |
| Domain Axis Upper Bound | none | Only applies to XY plots. Domain axis upper bound. For a date axis, this value must be expressed in the date format specified by the Date format parameter. |
| Domain Axis Tick Unit | none | Only applies to XY plots. Domain axis units between axis tick marks. For a date axis, this value represents a count of the units specified in the Time Period parameter. The Time Period unit can be overridden by specifying a trailing character: y (years), M (months), d (days), h (hours), m (minutes), s (seconds), u (milliseconds). |
| Domain Axis Label Angle | none | Only applies to XY plots. The angle for the domain axis label, in degrees. |
| Category Label Position | none | Placement of the axis label text for categories.
|
| Date Tick Mark Position | start | Placement of the date tick mark.
|
Pie Chart Parameters
| Parameter | Default | Description |
|---|---|---|
| Pie Section Label | Show only the pie section key value | Format for how pie section labels are displayed. The format uses a string with special replacement variables:
Example 1: "%0% = %1%" would display something like "Independent = 20" |
| Pie Section Explode | No exploded sections | Comma separated list of pie keys that are to be shown exploded. Note: requires jFreeChart version 1.0.3 or higher. |
Attachment Parameters
These are advanced options that can be used for chart versioning, to enable automation 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 Pluginto improve performance. Depending on the options chosen, chart images can be versioned for historical purposes.
| Parameter | Default | Description |
|---|---|---|
| Attachment | none | The name and location with which the chart image will be saved as an attachment. The user must be authorised to add attachments to the page specified.
|
| Attachment Version | new | Defines the the versioning mechanism for saved charts.
|
| Attachment Comment | none | Comment used for a saved chart attachment. |
| Thumbnail | false |
|
Examples
Pie Chart
Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | pie |
| ![]() | ||||||||
| Chart Title | Fish Sold 2011 | ||||||||||
| Show Legend | true | ||||||||||
| Content Orientation | vertical | ||||||||||
| |||||||||||
Bar Chart
| Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | bar |
| ![]() | ||||||||||||
| Chart Title | Fish Sold | ||||||||||||||
| Show Legend | true | ||||||||||||||
| |||||||||||||||
3D Bar Chart
| Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | bar |
| ![]() | ||||||||||||
| Show in 3D | true | ||||||||||||||
| Opacity | 50 | ||||||||||||||
| Show Legend | true | ||||||||||||||
Time Series Chart
| Parameters in Macro Browser | Data Tables in Macro Placeholder | Rendered Chart | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Time Series |
|
| ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Date Format | MM/yyyy | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Time Period | Month | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data Orientation | vertical | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Range Axis Lower Bound | 0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Show Legend | true | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
XY Line Chart
| Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | xyLine |
| ![]() | ||||||||||||
| Show Legend | true | ||||||||||||||
| |||||||||||||||
XY Area Chart
| Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | xyArea |
| ![]() | ||||||||||||
| Show Legend | true | ||||||||||||||
Area Charts
Example 1
| Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | area |
| ![]() | ||||||||||||||||||||
| Show Legend | true | ||||||||||||||||||||||
| Width | 300 | ||||||||||||||||||||||
| Height | 300 | ||||||||||||||||||||||
| Opacity | 50 | ||||||||||||||||||||||
| |||||||||||||||||||||||
Example 2
| Parameters in Macro Browser | Data Table in Macro Placeholder | Rendered Chart | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | area |
| ![]()
| ||||||||||||||||||||
| Show Legend | true | ||||||||||||||||||||||
| Width | 300 | ||||||||||||||||||||||
| Height | 300 | ||||||||||||||||||||||
| Stacked Values | true | ||||||||||||||||||||||
|
Related Topics
Take me back to the Confluence User's Guide.















48 Comments
Hide/Show CommentsJan 09, 2009
Don Gamble
Is there a way to control the color of the text labels?
Jan 09, 2009
Bob Swift
No, but it would be a valid improvement request.
Mar 20, 2009
Anonymous
Hi,
Is there a way to insert a numeric value in the body of a bar in the bar graph?
Thanks
Mar 29, 2009
Azwandi Mohd Aris [Atlassian]
I am sorry that this feature is not available in the macro. Perhaps, this feature request might be the one you after?
Jul 16, 2009
Anonymous
Hi,
Does this macro allow you to use an attachment (say a CSV file) as the data source?
Thanks.
Jul 16, 2009
Sashidaran Jayaraman [Atlassian]
Hi,
This is possible with the use of another plugin called CSV Macro.
Hope this helps.
Cheers
JSashi
Jul 20, 2009
Anonymous
Hi,
Can you chart off a "dynamictable" macro?
Steve.
Aug 10, 2009
Zed Yap [Atlassian]
Hi Steve,
I am afraid that the feature requested is not available yet. Since, the dynamic macro is not part of this list:
However, you might want to raise a feature request in JIRA:
Hope that helps.
Best rgds,
Zed
Jul 09, 2010
Anonymous
Can I change the line style on a line graph? I'd like to make some dashes as opposed to solid.
Aug 16, 2010
Sashidaran Jayaraman [Atlassian]
Hi,
I am afraid that this is not currently possible. However, I have found a similar feature request Please add yourself as a watcher, vote for this feature and add your own comments to this feature request. For further details on how we include new features and improvements, you might want to read this page
Cheers
JSashi
Oct 05, 2010
Anonymous
Is there a way to specify the colors of the wedges of a pie chart?
we use green = on time, blue = late and red = very late. The standard colors work OK; however, if there are none in a particular category, the colors move around.
This one works:
But this one does not:
Thanks for your assistance,
Jan 21, 2011
Anonymous
Have you tried adding a wedge with a value of 0 as a place holder to keep the color assignments the same?
Sep 22, 2011
Anonymous
Is there any way to make multiple charts from one table. ie use columns 1,2 and 3 of a table for one graph and then 1,2 and 5 for some other graph? This is pretty much essential if the table's are generated by sql queries (and the SQL macro) because it becomes very inefficient to run 5 similar queries for 5 graphs.
Thanks
Iain
Feb 28, 2011
Bob Swift
Put the sql query on a separate page surrounded by the cache macro. Include the sql page for each chart using the include macro. Use the columns parameter in the chart macro for the column selection.
Dec 08, 2010
Anonymous
Is it possible to add a vertical line to mark the median value on the x axis? For example, when charting a count of items by age, to indicate the median age. Thanks
Jan 05, 2011
shlomi Podgorovich
Hi,
Is there a way to view the data labels ( like in excel) in a graph?
I am not referring to the label name but to the value of the graph column.
Thanks,
Feb 05, 2011
Peter Alfvin
I'd like to create a line chart where some of the lines don't extend all the way to the right, as used in an "actual vs. plan" chart. However, if I leave the corresponding cells of the input table blank, they are treated as zeros, resulting in the line dropping to the x-axis at the point of the nulls and continuing on from there.
Am I missing something? Is this a feature request matter? Has a request already been submitted?
Thanks in advance for any info.
Pete Alfvin
P.S. I tried to include an image to show what I was looking for, but it wouldn't let me drag/drop a .jpg file from my desktop through Insert Image.
Dec 21, 2011
Anonymous
Same thing happened to me and I separated the data into two tables to work around the issue.
Instead of:
{chart} || Date || Planned || Actual || | Jan 1 | 100 | 100 | | Jan 2 | 75 | 75 | | Jan 3 | 50 | | | Jan 4 | 25 | | | Jan 5 | 0 | | {chart}Do this:
{chart} || Date || Planned || | Jan 1 | 100 | | Jan 2 | 75 | | Jan 3 | 50 | | Jan 4 | 25 | | Jan 5 | 0 | || Date || Actual || | Jan 1 | 100 | | Jan 2 | 75 | {chart}Each day you add a value to actual, you create the row with the date and actual value.
Feb 28, 2011
Anonymous
If I have an SQL plugin returning multiple tables, is there a way to have multiple charts based on that content? Splitting the SQL isn't an easy option since the data is built dynamically from relatively complex SQL.
Feb 28, 2011
Bob Swift
Almost
. The tables parameter is meant for things like this. It is a way to specify explicitly what tables in the body are to be used for a chart. Macros like sql, table-plus, csv, excel all have an id parameter to explicitly put an id on a table. Unfortunately, the sql macro does not auto-increment the id for multiple result set tables. I have created SQL-109 to cover this case.
Feb 28, 2011
Anonymous
Thanks! So the multiple chart macros don't need to wrap around the SQL macro if the tables are numbered are somewhere in the page body? Have I got that right?
Feb 28, 2011
Bob Swift
I wasn't as complete as I needed to be. Any tables the chart macro needs to access MUST be in the body of the chart macro. In your case you probably need to use this technique as well once the issue gets fixed.
Mar 22, 2011
Okan A.
Is there a way to drill down on charts? In other words, can I make the data points on a chart dynamic?
Mar 22, 2011
Anonymous
Is there a way to limit the width of the chart to a certain number of pixels irrespective of the data domain ?
^|____,____100
and for same width in pixels
|____,_____20
Apr 01, 2011
Anonymous
How to show DateTickMarks in "xyline" charts?
How to use domainAxisTickUnit in "line" chart? This setting is neglected.
How to change order of functions on "xyline" and "line" charts? Function drawn later overlaps function drawn earlier.
Thanks
Jun 29, 2011
Anonymous
Is there any possible way to develop a time series chart but instead of a line, it has the area shaded in??
Jul 06, 2011
Anonymous
Is it possible to have a hyperlink in the chart? So when i press my line I get forwarded to another page?
Jul 14, 2011
Anonymous
Have you figured out how to get the drill through working?
Jul 14, 2011
Bob Swift
I have used imagemap macro in the past for things like this.
Jul 28, 2011
Anonymous
Can i have a chart with x-axis = day and y-axis = hour of the day?
Jul 28, 2011
Anonymous
Is the Gantt option of the chart macro still in beta? I am having trouble using it because the example code is not working for me
Thanks!
Aug 09, 2011
Barri Jansen
Why isn't it possible to set the stacked=true parameter on the XY-plots charts.
I've a timeseries data-range with 1 year of data, for each day a value. Plotting this in an Area chart the x-axis losses precision. With the xyArea chart I can set the domainAxisTickUnit=1M parameter. Which result in a nice x-axis showing each month!
The data really makes more sense showing stacked. So I've to use the area chart, now I'm missing the x-axis :-(
Aug 09, 2011
Anonymous
Hi - is there a list of colours that can be used?
Thanks and kind regards from Switzerland
Aug 25, 2011
Kenneth Houmark
How do i turn a table (a SQL result) like this into a bar chart where y axis is Hours and the x-axis has a bar for each pair of User,Customer:
User
Hours
Customer
Paul
30
C1
Paul
2
C2
Lola
3
C3
Using type = bar and dataOrientation=vertical does not work. Even tried with yLabel=Hours
Been struggeling for hours! :D Would really help my company.
Sep 23, 2011
Mike Frohme
Hi Kenneth,
This may not be the most helpful answer, but combining the User and Customer data into a single column with type bar" and orientation "vertical" accomplishes what you want, e.g.
{chart:type=bar|dataOrientation=vertical|displayData=true}
Aug 31, 2011
Anonymous
I'd like to mark today's date in a gant chart with a vertical line, is that possible?
Sep 07, 2011
Anonymous
Dear All
Is it possible to assing rangeAxisLowerBound to the minimum value automatically in dataset. I only see manual forcing of lower and uppper bound something like |rangeAxisLowerBound=0I.
Thank you very much.
Sep 23, 2011
Anonymous
I liked the old version of this page much better. In the new version it is not clear how the parameters are named.
For example, the parameter borderColor is now called "Border Colour". This isn't very helpful
Sep 23, 2011
Mike Frohme
I agree completely - some names are directly related to what's in the description - e.g. dateFormat = "Date Format" but parameter rangeaxisupperbound is not intuitively obvious from "Range Maximum Value" though the Domain axis appears to be better.
I actually downloaded and scrounged the source to get to that ... grrr.
Oct 04, 2011
Paul Watson [Atlassian Technical Writer]
Hi Mike,
Thanks for your comment. By way of explanation, the parameter descriptions on this page match those in the Macro Browser, which is what you use to configure macros in Confluence 4.0.
I assume that you are using a version of Confluence earlier the 4.0. I think you will find the information you require if you refer to the version of the documentation that is relevant for your version of Confluence. Links are available at the top left of this page.
I hope this helps,
regards
Paul
Oct 04, 2011
Brooke Gravitt
Wouldn't it be nice to include a code block with each example? You know, if only Confluence allowed you to do something like that...
Pie Chart Example:
Oct 05, 2011
Anonymous
Is there a reason why there is no selection in the parameters for the type of chart? Any time I make an edit to my bar chart, it reverts back to a pie chart and I have to start over again. I cannot seem to even open the wiki markup anymore to make the adjustments.
Oct 15, 2011
Anonymous
Regarding the chart type bar parameters: Is there any way of displaying the numeric amount values over each specific bar?
Nov 17, 2011
nicolas frank
The plugin is not properly working with confluence 4.x : you can't chose the chart type through the ui... so you can only create pie graphs (and as you can't access the wiki markup anymore... so no way to do this manually...)... we are blocked by this issue... I raised a bug on the plugin JIRA site, please fix this quick !!!
Dec 11, 2011
Anonymous
The following parameters are documented wrong in the table above and they really should be:
Sets whether to display the rendered body of the macro (usually the data tables). By default, the chart data table isn't rendered.
Dec 12, 2011
Paul Watson [Atlassian Technical Writer]
Thanks for your comment!
You are describing an older version of Confluence, while this page describes the Chart Macro in Confluence 4.0.x.
regards, Paul
Feb 08, 2012
lecaros
I'd like to display stacked values in a bar chart considering it's percentage in y axis. Let's say we have following table
It should display 2 bars, one for Sand1 and one for Sand2, both bars should have same size and vary colors according to percentage. Say, Bacon-color in Sand1 should cover 90% of the bar, Green stuff color should use the 10%... same applies for Sand2's bar, 67% for bacon 33% for green stuff.
Is this currently supported in chart macro?
thanks in advance!
Feb 09, 2012
Anonymous
In confluence 4.1 how to create different chart types using Jira filters (jiraissues) and use them in WIki?
Add Comment