- SAP BusinessObjects Dashboards 4.1 Cookbook
- David Lai Xavier Hacking
- 1151字
- 2021-07-23 19:44:02
Adding a line chart to your dashboard
A line chart is very useful to visualize data that changes over time. It consists of a set of data points that are connected by a line. The horizontal x-axis typically shows the categories in which the data is divided. The vertical y-axis shows us the values.
This recipe shows how to add a line chart to a dashboard and how to link it to the data in the spreadsheet. We will also discuss the components that are similar to the line chart component: bar chart, column chart, area chart, stacked chart, and the Marimekko chart.
Getting ready
Open a new file in SAP BusinessObjects Dashboards and enter the data into the spreadsheet, as shown in the following screenshot:

How to do it...
- Drag a Line Chart component from the Components browser into the canvas:
- Select the Line Chart component you just added to the canvas by clicking on it. Now, the component is surrounded by eight blocks that enable you to adjust the size of the component.
- The properties pane for this component is also visible now. By default, the General tab is selected. In the Data section we can bind the data we entered earlier in the spreadsheet to this component. Click on the button on the right-hand side of the By Range field:
- In the spreadsheet, select the range from A4 to E7 and click on OK. The data is now bound to the component:
- The Data section of the properties pane now looks like what is shown in the following screenshot. The chart will show the data series we just bound.
- In the same way, we can add titles to this chart. Select spreadsheet cell A1 and enter
Sales data
; also, enter2011
in cell A2. - Bind the Chart field in the properties pane with spreadsheet cell A1 and bind the Subtitle field with cell A2.
- In the Category (Y) Axis field, enter
Tonne
. - Your setup should now look like what is shown in the following screenshot. Click on the Preview button to try the dashboard.
How it works...
The preceding section showed how to connect data in one or more spreadsheet cells to the Line Chart component through several options in its properties pane. This is how we bind data and you will be using this a lot during the development of dashboards with SAP BusinessObjects Dashboards.
There's more...
In this section we will discuss manually binding data to charts and how to hide and show data series in a chart. We will also go through some other chart components that work in a similar way to the Line Chart component.
In this recipe, we used a pretty straightforward dataset with the category labels in the first row (Q1, Q2, Q3, and Q4) and the series names in the first column (Apple, Banana, and Cherry). SAP BusinessObjects Dashboards is able to understand this dataset and bind this information automatically. However, this may not always be the case, and therefore, not always lead to the visualization you had in mind.
To change the direction of the visualization of the spreadsheet data in the chart, you can select the Data in Columns option in the Data section of the properties pane. This will switch the series and the labels.
By clicking on By Series in the Data section of the properties pane, it is possible to manually adjust all binding settings for the name and values of each series. Additionally, you can select the axis a series should be plotted on (primary or secondary). You can change the series order by using the two arrow buttons and add or remove series by using the + and - buttons. Also, you can manually bind the category labels to a range of cells shown in the following screenshot:

Series in a chart can be hidden or shown by the user when using the dashboard by following these steps:
- Go to the Appearance tab and select the sub-tab Layout.
- Make sure that Enable Legend is selected.
- Select Enable Hide/Show Chart Series at Run-Time.
- Set Interaction to Check Box.
- Click on the Preview button to try this feature.
In the following sections, several other chart types will be introduced. These charts work roughly in the same way as the line chart component.
The bar chart and column chart components can be configured in exactly the same way as a Line Chart component. A bar chart presents values in horizontal bars while the column chart uses vertical bars. These types of charts are typically not used to present data over a long time period, but to show data from different categories that need to be compared. The following screenshot shows the bar chart and column chart representation:

The area chart component is a line chart with a filled area beneath the line. Another difference between these two types of charts is that in an area chart, the first value (Q1) is plotted on the far left-hand side and the last value (Q4) on the far right-hand side of the chart. An area chart is used to visualize the cumulated total value of the series over a period of time. This component can be configured in the same way as the line chart component. The following screenshot displays an area chart:

The bar chart, column chart, and area chart components all have a stacked versions: stacked bar chart, stacked column chart, and stacked area chart. These stacked chart components show the values of the series on top of each other in the same column. You can use stacked charts if the dashboard user wants to compare totals, as shown in the following screenshot:

The Marimekko chart is a special type of stacked chart. Instead of displaying absolute values, the bars now have the same height and the segments of each bar represent a percentage of the total. The same principle counts for the width of each bar. The following screenshot displays a Marimekko chart:

The setup of the Marimekko chart component is similar to the other stacked chart components, with only one addition. In the Data section of the General tab of the properties pane, we will now find the option to bind category values, which will determine the width of the bars as seen in the following screenshot:

- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Java面向?qū)ο筌浖_(kāi)發(fā)
- 面向STEM的Scratch創(chuàng)新課程
- Koa開(kāi)發(fā):入門(mén)、進(jìn)階與實(shí)戰(zhàn)
- Learning FuelPHP for Effective PHP Development
- Python數(shù)據(jù)結(jié)構(gòu)與算法(視頻教學(xué)版)
- Apache Camel Developer's Cookbook
- Deep Learning with R Cookbook
- Unity 2017 Game AI Programming(Third Edition)
- Java高并發(fā)編程詳解:深入理解并發(fā)核心庫(kù)
- Mastering Leap Motion
- 金融商業(yè)數(shù)據(jù)分析:基于Python和SAS
- Learning WordPress REST API
- HTML并不簡(jiǎn)單:Web前端開(kāi)發(fā)精進(jìn)秘籍
- PHP程序設(shè)計(jì)高級(jí)教程