How can I have two Stacked bar toget like Simple Bar Char?

Hello there,

I have data like [
{ year: 2019, Actual_A: 10, Actual_B: 15, Est_A: 11, Est_B: 10},
{ year: 2020, Actual_A: 11, Actual_B: 14, Est_A: 14, Est_B: 12},
{ year: 2021, Actual_A: 12, Actual_B: 13, Est_A: 11, Est_B: 2-}
]

I want a bar chart by year where the Actual_A and Actual B are stacked, Est_A and Est_B are stacked. And the Actual and Est are side by side like simple bar chart.

Is it possible to do this? and How?

Thanks,

John


3 Replies

DG Durga Gopalakrishnan Syncfusion Team December 16, 2021 03:21 PM UTC

Hi John, 

Greetings from Syncfusion. 

We suggest you to use stackingGroup to achieve your requirement. Please check with the below snippet and sample. 

<ejs-chart> 
         <e-series-collection> 
                <e-series stackingGroup="Group1"> </e-series> 
                <e-series stackingGroup="Group1"> </e-series> 
                <e-series stackingGroup="Group2"> </e-series> 
                <e-series stackingGroup="Group2"> </e-series>                
         </e-series-collection> 
  </ejs-chart> 


 
 

Kindly revert us if you have any concerns. 

Regards, 
Durga G 



JC John Chen December 17, 2021 03:02 PM UTC

Thanks Durga,

It works great.

John



DG Durga Gopalakrishnan Syncfusion Team December 20, 2021 06:27 AM UTC

Hi John, 

Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you. 

Regards, 
Durga G 


Loader.
Up arrow icon