This example shows how to create a pie chart using simple configuration view.
| A panel similar to the one in this section is used for the following chart types: Pie, SemiPie. |
To create the report for the chart:
| 1. | Create a new, blank report using the Sample DB data adapter and the query: select * from orders. |
| 3. | Click |
| 4. | Delete all bands except for Title and Summary. |
| 5. | Enlarge the Summary band to 500 pixels by changing the Height entry in the Band Properties view. |
To create the chart:
| 1. | Click |
The HTML5 Chart Edit Dialog is displayed.
| 1. | Create a new report using the Sample DB data adapter. |
select * from orders
| 3. | Choose |
The HTML5 Chart Edit Dialog is displayed.
| 4. | Select a chart type based on the information you want to display. You can use the menu at the left to restrict the selection to a particular type of chart. For this example, choose Pie. |
| 5. | Click the Data Configuration tab. This tab includes options for configuring chart dataset, chart properties, and hyperlinks. The options on this tab reflect the type of chart you selected. The dialog shown in this example is used for pie and semi-pie charts. |
|
HTML5 Charts Properties > Chart Data > Configuration |
| 6. | Enter the required information on the Data sub-tab. For this example: |
| • | Slice Expression – Enter the expression you want to use for the slices. You can enter the expression directly, or click |
| • | Value Expression – Enter the expression you want to use as a base for the measure calculation. For this example, use $F{ORDERID}. |
| • | Aggregation Function – Select the function to apply to the value expression. For this example, use DistinctCount. |
| • | Tooltip Expression – Enter an expression to display when a user hovers over a slice of the pie. For this example, enter "Orders". |
| • | Ordering – Select an order for the slices. For this example, choose Ascending. This displays the slices in alphabetical order. |
| 7. | To preview the chart from inside the dialog box, click Show Chart Preview. |
A preview is displayed to the right of the dialog. This preview can take some time to load the first time it is run.
| 8. | Click the Dataset sub-tab. This sub-tab lets you choose a dataset and dataset properties. For this example, use the default [Report main dataset]. |
| 9. | You can optionally filter the dataset by entering an expression in the Increment expression text box. You can enter text directly or click |
$F{SHIPCOUNTRY}.startsWith("I") ||
$F{SHIPCOUNTRY}.startsWith ("S") ||
$F{SHIPCOUNTRY}.startsWith ("U")
| 10. | Click |
|
HTML5 Charts Properties > Chart Data > Configuration |
| 11. | Click OK to close the HTML5 Chart Edit dialog. |
A placeholder for the chart is inserted in design view of your report. The Design view of a report doesn't display live data for a chart.
| 12. | Save, then click the Preview tab to see your chart. To see an interactive preview, select HTML from the Preview drop-down. Hover over a pie segment to see the number of orders |
|
Pie Chart Example |
Recommended Comments
There are no comments to display.