To create a bi-directional bar chart, follow the steps below:
Convert half of the data source values from positive to negative. In this demo, the
male percentages are negative, while the
female are positive.
Implement a rotated stacked bar chart. Use the commonSeriesSettings object to specify the type and the argumentField property (
age in this case). Set the rotated property to
Declare two objects in the series array: one for negative values, the other for positive. Specify the color, name, and valueField for each series.
Change the label text of the valueAxis so that the negative values appear as positive. To implement this technique, use the customizeText function.
To further customize your bi-directional bar chart, implement tooltips and change the legend's alignment.