How to group stacking series in the JavaScript ejChart?
By default, stacking series are rendered in such a way that all the series are stacked. This is not desired when there are many stacking series in the JavaScript Chart. In such cases, the Essential Chart provides options to group the stacking series by using the stackingGroup property.
For example, consider four stacking column series grouped into two; GroupOne and GroupTwo by using the stackingGroup property. Then chart is rendered in two stacking columns at a point; one for GroupOne and the other for GroupTwo. The following code example illustrates the use of the stackingGroup property.
JS
$("#container").ejChart({ commonSeriesOptions: { type:'stackingcolumn' }, series: [ { . . . . . . . . . . . . . . stackingGroup: 'GroupOne' }, { . . . . . . . . . . . . . . stackingGroup: 'GroupTwo' }, { . . . . . . . . . . . . . . stackingGroup: 'GroupOne' }, { . . . . . . . . . . . . . . stackingGroup: 'GroupTwo' }, ] });
The following screenshot displays the Chart before grouping.
The following screenshot displays the Chart after grouping stack columns into two groups.
JS Playground sample link: Stacking Group
Conclusion
I hope you enjoyed learning about how to group stacking series in the JavaScript ejChart.
You can refer to our JavaScript Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Chart example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!