I. Overview
1.1 Application
The chart can customize the axis label format. For example, the axis label of the X axis of the whirlwind chart defaults to a negative value on the left side.
You can modify these negative axis labels to positive values to achieve data comparison on both sides, as shown in the following figure:
1.2 Realization Idea
The axis label format can be customized under the chart attributes pane, Style>Axis>X Axis>Custom, as shown in the following figure:
II. Example
2.1 Data Preparation
Create a new normal report and add the Emedded dataset populationpyramid to record the relevant data of men and women of different age groups, as shown in the following figure:
2.2 Insert Chart
Take the cell chart as an example, merge a cell and insert a custom Bar Chart, as shown in the figure below:
2.3 Bind Data
Select the chart and bind the chart data, as shown in the figure below:
2.4 Custom Axis Label Format
1) Delete X Axis2 under Chart Attributes Pane Style> Axis, and add Y Axis2, as shown in the figure below:
2) Set the Maximum and Minimum values of the X axis, as shown in the figure below:
3) Customize the X-axis format to make the X-axis symmetrically distributed, as shown in the figure below:
The custom code is as follows:
function(){ if(this>0) return this+'%'; else return this*(-1)+'%'; }
4) Under Style> Series in the chart attributes pane, add Stack and Axis1, as shown in the following figure:
2.5 Preview Effect
Save the template, click Pagination Preview, the effect is as shown in the figure below:
Note:Support both App and H5 terminal preview.