Spider charts, also called radar charts, are a two-dimensional chart type designed to plot one or more series of values over multiple common quantitative variables by providing an axis for each variable, arranged as spokes around a central point. The values for adjacent variables in a single series are connected by lines. Frequently the shape created by these lines is filled in with color.
In Jaspersoft Studio, spider charts are in a separate element from the rest of the charts available in the Community Project. This is because they are a separate component in JasperReports Library. However, you use them the same way you use other JFree Charts.
|
To filter your data in a Spider Chart, you must filter it in the Dataset and Query dialog.
|
To create the report for the chart:
|
1.
|
Open a new, blank report using a landscape template and the Sugar CRM database. Use the following query: |
select * from orders
Click Next.
|
2.
|
Move all the fields into the right-hand box. Click Next. |
|
3.
|
No need to group by any field. Click Finish. |
|
4.
|
Right-click on each band in the outline view, and choose Delete to delete all bands except for Title and Summary. |
|
5.
|
Drag a Static Text element into the title bar, and name your report something like “Employee Orders by Month and Country”. |
|
6.
|
Enlarge the Summary band to 350 pixels by changing the Height entry in the Band Properties view. |
To create a spider chart:
|
1.
|
Drag the Spider Chart element from the Palette into your report. |
|
2.
|
Select the report in the Outline view, and in the Properties tab, click the Edit query, filter, and sort options button. |
The Dataset and Query dialog opens.
|
3.
|
To filter data so that the chart is more readable, click the Filter Expression tab and add the following expression: |
( $F{shipcountry}.startsWith("N") || $F{shipcountry}.startsWith("M") || $F{shipcountry}.startsWith ("U") || $F{shipcountry}.startsWith ("I") ) || $F{shipcountry}.startsWith("A") && ( $F{shipname}.startsWith( "M" ) || $F{shipname}.startsWith( "A" ) || $F{shipname}.startsWith( "G" ) )
Do not include any manual line breaks.
Click OK.
|
4.
|
Double-click the chart. The Chart Data Configuration dialog opens. |
|
5.
|
Click the Series button and create the series $F{employeeid}. |
|
6.
|
Click the Value button and create the value MONTH($F{orderdate}). |
|
7.
|
Click the Category button and create the category $F{shipcountry}. |
To customize the look of your chart:
|
1.
|
Single-click your chart, and click the Properties view. |
|
2.
|
In the Legend category, set the drop-down menu for Show Legend to True. |
|
3.
|
Use the Position drop-down, to move the legend to the left. |
|
4.
|
Drag a Static Text element just to the left and above the legend. Label the legend Employee Number. |
|
5.
|
Save your report. The Design view should look like the following: |
|
6.
|
Preview your report. It should look like the following: |