Overview
Application Scenario
Setting gap backgrounds is intended to enhance the overall chart expressiveness and highlight certain important content in a chart. The following figure shows the effect.
You can use the Default Gap function, but the effect of this function is preset and may not meet your actual needs. In this case, you can customize the gaps by the Custom Gap function.
This document provides two examples of single-category and multi-category scenarios, as the configurations on the two scenarios differ.
Function Entry
The following figure shows the entry for customizing gap backgrounds. You can add multiple custom effects.
Gap Background Setting for the Single-Category Chart
Data Preparation
Create a database query named ds1 with the SQL statement SELECT * FROM Sales_Volume, as shown in the following figure.
Chart Insertion
Merge required cells and insert a column chart, as shown in the following figure.
Data Binding
Bind the data to the column chart and set only one category, as shown in the following figure.
Custom Gap Background
Since the sales performance of Steven and Sophia is not satisfactory, you may want to highlight their sales data by setting Gap Background. The following shows the setting method:
First, add a background to the data of Steven. The following figure shows the setting steps. Note that you need to set both the Lower Bound and Upper Bound values, which function as a range for the background color area. Otherwise, the setting will not take effect.
Add the category name for both the Lower Bound and Upper Bound values. Note that you must enter the category name in the form of a formula, for example, ="Steven".
Then, add a background for the data of Sophia. The following figure shows the setting steps.
Effect Display
1. PC
2. Mobile Terminal
Custom Gap Background for the Multi-Category Chart
Data Preparation
Create a database query named ds1 with the SQL statement SELECT * FROM Sales_Volume, as shown in the following figure.
Chart Insertion
Merge required cells, and insert a column chart, as shown in the following figure.
Data Binding
Bind the data to the column chart and set three categories, as shown in the following figure.
Custom Gap Background
In this example, add gap backgrounds to the data of odd-numbered salespersons to make the chart look less monotonous. The following figure shows the setting method.
First, set the data background for the first salesperson Mike. The following figure shows the setting steps.
The setting of both the Lower Bound and Upper Bound values for multi-category charts differs from that of single-category charts and needs to be set according to the sequence of multiple categories. You must also enter the category names in the form of aformula, for example, =["New York","Mike","Beverages"].
Set the data background of the third salesperson Steven. The following figure shows the setting steps.
Set the data background of the fifth salesperson James. The following figure shows the setting steps.
Effect Display
1. PC
2. Mobile Terminal
Template Download
Template for the Single-Category Chart
For details, you can download the template: Custom Gap Background for a Single Series.cpt.
Template for the Multi-Category Chart
For details, you can download the template: Custom Gap Background for Multiple Series.cpt.