You can control some aspects of how data points, field names and labels are displayed on your chart, including:
| • | Whether data points are displayed. |
| • | Showing a measure name on charts including only a single measure. |
| • | Restricting the number of labels displayed. |
| • | Rotating the direction of label text. |
| • | Selecting the colors used by the chart. |
| • | Defining how gauges are displayed. |
JasperReports Server also allows you to edit many of the chart's properties for cases when you want more control over the appearance of a chart.
Displaying Data Points
You can choose whether to display data points in your line, time series, or area chart. Data points can help users visualize chart data more accurately.
To show data points on a chart:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 3. | Click the Appearance tab and select Show data points on line charts. |
| 4. | Click OK. The name appears along the value axis. |
| 5. | To remove data points from the chart, open the Appearance tab and deselect Show data points on line charts. |
The Advanced tab on the Chart Format window gives you more control over the appearance of an Ad Hoc chart by allowing you to edit certain chart properties. For example, you can specify a list of colors for the chart, change the position of the legend, choose whether to display data values in the chart, and much more. You can find a full list of supported commands by clicking the More Information link on the Advanced tab or browsing to the Advanced Chart Formatting page Chart Format Window |
|
Displaying the Measure Name on the Value Axis
By default, in charts that include only a single measure, that measure's name is not displayed. For instance, if your measure displays the number of employees for each store in the region, that measure's label appears along the Y- (or value) axis, but the name of the measure ("Number of Employees" or similar) does not. You can, however, choose to display that measure name to clarify the information on your chart.
To show a measure name on the value axis:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 4. | Select Show measure name on value axis. |
| 5. | Click Apply, then OK. The name appears along the value axis. |
| 6. | To remove a measure name, open the Labels tab and deselect Show measure name on value axis. |
Restricting Label Display
By default, every field included in your chart has a label displayed along either axis. Measures will show up as numeric values, often along the Y axis, and fields being measured will show up as text along the X axis. On some charts - especially those with many included fields - these labels may overlap, crowd together, or become difficult to read. You can alleviate this problem by "stepping," or reducing, the number of labels displayed on your chart.
To reduce the number of labels on your chart:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 4. | In the Interval between X-axis labels numeric entry box, specify how often you want the axis label to appear. For instance: |
| • | To display every second label, enter 2. |
| • | To display every third label, enter 3, and so on. |
| 5. | Repeat this process in the Interval between Y-axis labels numeric entry box. |
| 6. | Click Apply, then OK. The labels appear as entered. |
| 7. | To display every label, open the Axis tab and enter 1 in the numeric entry boxes. |
Rotating Label Text
By default, labels on your chart are displayed horizontally. Multiple labels, or very long ones, can be difficult to read. You can change the direction of these labels, on both the X and Y axes, to improve chart readability.
To rotate label text:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 4. | In the Rotation of X-axis labels specify the degree of rotation to apply to labels. For instance: |
| • | To rotate labels clockwise 90 degrees, enter 90. |
| • | To rotate labels counter-clockwise 90 degrees, enter -90. |
| • | To rotate labels clockwise 45 degrees, enter 45, and so on. |
| 5. | Repeat this process in the Rotation of Y-axis labels entry box for measures along the Y axis. |
| 6. | Click OK. The labels are rotated. |
| 7. | To return the labels to their original, horizontal position, open the Axis tab and enter 0 in the numeric entry boxes. |
Changing the Chart's Colors
You can choose the colors of your chart by defining a series of colors for it to use. You can also choose the background's colors.
To choose the chart's colors:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 3. | Click the Appearance tab. |
Appearance Tab |
|
| 4. | Under Series Colors, click + Add Series Color to add the first color. |
The color picker button appears. The button will display a color and a corresponding Hex value.
| 5. | Click on the button to open the color picker window. |
| 6. | Select the color you want to use. |
| 7. | Click outside the color picker window to close it. |
| 8. | Click + Add Series Color to add additional colors. |
| The order of the colors added to the chart is the order they appear in the series. |
Appearance Tab with Multiple Colors in Series |
|
| 9. | You can change the colors of the charts background and plot using the color picker buttons under Background Colors. |
| 10. | When you are done adding colors to the chart, click OK. |
JasperReports Server reloads the chart with the new colors.
Changing the Display Settings for Gauges
Gauges are circular and semi-arc charts. The length of the circle or semi-arc is based on a single data value in proportion to the minimum and maximum measurement amounts you define.
Gauges have their own display settings on the Appearance tab, where you can select how they appear in the Ad Hoc view. You can specify the layout of the gauges on the canvas, the color stops, and the minimum and maximum values for the gauge's measure.
The settings on the Appearance tab apply to all gauges in the Ad Hoc view.
To edit a gauge's display settings:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 3. | Click the Appearance tab. |
Gauge Settings on the Appearance Tab |
|
| 4. | Under Gauges, select the layout for displaying the gauges. By default, the layout is Best Fit, which displays all of the gauges on the canvas in one or more rows. The gauges can also be displayed in a single vertical column or a single horizontal row. |
| 5. | Enter the minimum and maximum values for the gauge's measure. For gauge and arc gauge charts, each measure added to the Ad Hoc view will be displayed as its own gauge and the gauge's circle or arc represents how a single data value in the data source compares to the maximum measure. For multi-level gauge charts, each measure is displayed as concentric circles in the gauge. By default, the minimum is 0 and the maximum is 100. The measures selected for the Ad Hoc view also determine whether to display the data as percentages or as numeric values. |
| 6. | Enter the number of decimal places to show as part of the value displayed in the gauge. The maximum number of decimal places you can specify is 8. |
| 7. | Enter a suffix string if you want to label the value displayed in the gauge. |
| 8. | Enter a value for each color stop for the gauge. Color stops define a gradient progression for the gauge's colors in the Ad Hoc view. The default color stop values are 0.2, 0.5, 0.7, and 1. |
| You can have a maximum of four color stops in your gauge. Each color selected is the specific color displayed at the corresponding stopping point. The colors displayed in the gauges are based on where the gauge's value falls on the defined gradient. |
| 9. | Click on the color picker button for each stop to open the color picker window and select the color. |
| 10. | When you are done changing the colors, click OK. |
JasperReports Server reloads the Ad Hoc view's gauges with the new display settings.
Changing the Chart's Appearance Using Advanced Formatting
on the Jaspersoft Community Site.
To edit the chart's properties:
| 1. | In the Ad Hoc View panel, click the |
| 2. | Select Chart Format... from the menu. The Chart Format window is displayed. |
| 3. | Click the Advanced tab. |
| 4. | Click Add New Property. |
| 5. | In the Property field, enter the chart property you want to format and then enter the value(s) for the property. For instance: |
| • | To format the chart's colors, enter colors for the property and a comma-separated list of colors in brackets for the values, such as ["red", "blue", "green", "magenta", "purple", "black", "yellow"]. |
| • | To change the vertical alignment of the legend, enter legend.verticalAlign for the property and "top" or "bottom" or "center" for the value. |
| • | To display data values on the chart, enter plotOptions.series.dataLabels.enabled for the property and true for the value. |
Click the More Information link to see a list of the properties you can edit.
| The Ad Hoc Designer does not validate the property name or values. The chart will ignore any invalid property you enter. |
| 6. | Click |
| 7. | Click OK. The chart is updated with the new formatting. |
| 8. | To remove the formatting, open the Advanced tab and click |
Recommended Comments
There are no comments to display.