Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

The chart macro combined with the sql macro provides powerful visual reporting capabilities. These macros were designed to work together. The sql macros produce standard Confluence tables. The chart macro produces charts from tables included in its macro body. Of course, the parameters of the chart macro must define a chart that can be produced from the format of the table (or tables) included in the chart macro body. So part of the challenge is to define the chart correctly to match with your table(s) produced by the sql macros and this depends on what you are trying to do and how you have constructed the sql. The chart macro has a number of parameters that can be adjusted to accommodate different table arrangements. We will show some simple examples here to get started. 

Steps

...

autoNumbertrue

...

  • Set the chart type, this example uses a pie chart
  • Edit other parameters as needed
  • For this example
    • Set Content orientation to vertical - this is required because we want to use table rows for the values
    • Optional: Set Display rendered data to after
    • Optional: Set Pie section label to %0% (%2%)

...

  • This is just a quick way to get the chart defined and working
  • Use insert table with a few rows and columns (see example below)
  • The test data needs to match the requirements of the chart type you have selected!

...

  • We are going to test to ensure that the sql-query macro is going to produce the correct format of table

...

  • Example SQL

...

select product as "Product", revenue as "Revenue" from revenue

...

  • Now you should have both macros configured correctly

...

  • Cut and paste the sql-macro into the body of the chart macro (discard or save the test data somewhere else)

...

 

...

dataDisplayafter
legendfalse
width500
attachmentVersionreplace
dataOrientationvertical
height500
pieSectionLabel%0% (%2%)
xthumbnailtrue

...

Include Page
SUPPORT:How to create a chart with SQL - 8.x
SUPPORT:How to create a chart with SQL - 8.x