Add a Chart
- Last updated
- Save as PDF
A chart can be the most important graphical element in your report. Charts show the report data visually so that readers can more easily see how the numbers compare. There are two types of charts in Report Designer: Traditional JFreeChart elements, and sparkline charts.
Choose a Chart Type
There are 17 JFreeChart chart types built into Report Designer, with some of them changing significantly based on which data collector you choose.
If you want to show the strength of a trend for a single value over time, the best chart types are:
- Line
- Area
- XY StepArea
- XY Step
- XY Line
If you are directly comparing two or more related values, the best chart types to choose are:
- Pie
- Ring
- Bar
- Line
- Area
- Radar
If you want to show how one set of values directly affects another, the best chart types are:
- Bar line combination
- Waterfall
If you are comparing a large number of data points, the best chart types are:
- XY Difference
- XY Dot (Scatter plot)
- Bubble
- Pie Grid (Multi-Pie)
If you need to show a trend among a small number of related numerical data points, a sparkline chart may be appropriate.
Create a JFreeChart Element
Perform the following steps to add a traditional graph or a chart to your report:
- Drag and drop a Chart element into a layout band.
- Using the resize handles, change the size of the chart to fit your specifications.
- Double-click the chart. An Edit Chart dialog will appear with dozens of customizable options and settings.
- Adjust the chart options to your preference, then click OK.
- Click Preview to verify that your chart appears as intended.
You should now have a suitable chart that visually represents the selected data.
Create a Sparkline Chart
Sparkline charts require comma-separated values (CSV) for input. If your data is not in CSV format, you must create a PDI transformation to put commas between each data point, or you can manually insert commas between your data points.
Perform the following steps to add a sparkline chart to your report:
- Drag and drop a Sparkline Pie, Sparkline Bar, or Sparkline Line element into a layout band.
- Using the resize handles, change the size of the chart to fit your specifications.
- Click the round green + icon in the Value row. A formula field will appear.
- In the formula field, select the function that formats your sparkline data, or type in comma-separated values by hand directly, then click Close.
- Click Preview to verify that your chart appears as intended.
Sparkline Attributes
The following attributes belong to the sparkline property:
Attribute Name | Purpose | Values |
---|---|---|
spacing | Specify the spacing (in pixels) between bars for a bar sparkline. | Integer; default is 0. |
start-angle | Specify the start angle (in degrees) on a pie sparkline. | Integer; values are from 1 to 360. Default is 1. |
counter-clockwise | Specify the plot direction on a pie sparkline. | Boolean; default is false, which represents clockwise. |
high-slice | Specify the hexadecimal color for the high slice. | String; there is no default, you must define it manually. |
medium-slice | Specify the hexadecimal color for the medium slice. | String; there is no default, you must define it manually. |
low-slice | Specify the hexadecimal color for the low slice. | String; there is no default, you must define it manually. |