Scatter charts plot two or more data series as points. The charts are intended to show raw data distribution of the series. The data is represented as follows:
| 1. | The first data series is represented as the x values. |
| 2. | The second data series is represented as correlated y values. |
| 3. | Any additional data series are plotted as y values correlated to the x values provided by the first series. |
As a result, a scatter chart always displays one less plot than the number of data series included.
Now let's create a scatter chart that shows maximum and average freight in each city for each year.
To create the report for the chart:
| 1. | Open a new, blank report using the SugarCRM database and the following query: |
select * from orders
Click Next.
| 2. | Move all the fields into the right box. Click Next then Finish. |
| 3. | Delete all bands except for Title and Summary. |
| 4. | Enlarge the Summary band to 500 pixels by changing the Height entry in the Band Properties view. |
To create the chart:
| 1. | Give your report a title like “Maximum and Average Freight in Years for City”. |
| 2. | Drag the HTML5 Charts element into the summary band, and select Scatter. |
| 3. | In the Outline view, right click the chart element, and choose Edit chart properties. |
| 4. | In HTML5 Chart Properties > Chart Data > Configuration create a Category with the following information: |
| • | Expression: $F{SHIPCOUNTRY} |
| • | Value Class Name: java.lang.String |
Click OK.
| 5. | Create a second Category with the following: |
| • | Expression: $F{SHIPCOUNTRY} |
| • | Value Class Name: java.lang.String |
Click OK.
| 6. | Create a Series with the following: |
| • | Expression: YEAR($F{ORDERDATE}) |
| • | Value Class Name: java.lang.Integer |
Click OK.
| 7. | Add a Measure for maximum freight: |
| • | Label Expression: “Max Freight” |
| • | Value Expression: ${freight} |
| • | Value Class Name: java.math.BigDecimal |
Click OK.
| 8. | Add a Measure for average freight: |
| • | Label Expression: “Average Freight” |
| • | Value Expression: ${freight} |
| • | Value Class Name: java.math.BigDecimal |
Click OK.
Your Chart Properties dialog should look like this:
Scatter Chart Properties |
|
To change the position or layout of the legend:
Legend Properties |
|
| 1. | Open HTML5 Chart Properties and click the Chart Properties tab. |
| 3. | Check the boxes for Show Legend and Floating Legend. |
| 4. | Use the drop-down menus to arrange the legend to appear in the top left by setting Offset X and Offset Y to appear within the plot area. |
Click OK.
To add a border to the chart:
| 1. | Open HTML5 Chart Properties and click the Chart Properties tab. |
| 2. | Click the arrow next to Chart and highlight Borders and Plot Area. |
| 3. | Create a border for your chart by using the arrows next to Plot Border Width or by typing the number of pixels. |
| 4. | Select a Border Color, Border Radius, and Border Width. |
Border Properties |
|
| 6. | Save and preview your report. It should look like this: |
Scatter Chart |
|
Recommended Comments
There are no comments to display.