We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Combination chart with Stacked Bar

We are using the JavaScript chart control in one of our projects and we're trying to set up a combination spline/stacked column chart.  We've reviewed the documentation/demo for the combination chart but are having difficultly with the syntax to add a new series in the column to create the stack.  We're going for an end result similar to the image below.  Do you have any examples that show multiple series in a combination?  Thanks.



1 Reply

DD Dharanidharan Dharmasivam Syncfusion Team April 24, 2017 06:17 AM UTC

Hi Dwaine, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. To stack the column series you can use stackingColumn series type. With respect to the screenshot, we have prepared a sample, in which the first two series are rendered as stackingColumn and for third series we have used spline type and bind it to the secondary Y axis, to achieve your requirement. Find the code snippet below. 

JS: 

$("#container").ejChart( 
        { 
//Axes to add spline series 
           axes: [{ 
                    majorGridLines: 
                    { 
                             visible: false 
                    }, 
                    orientation: 'Vertical', 
                    opposedPosition: true, 
                    axisLine: { visible: false }, 
                    name: 'yAxis', 
                   range: { min: 0, max: 12, interval: 2 } 
                } 
            ], 
 
         series: [ 
                     { 
                          //... 
                          type: 'stackingcolumn', 
                     }, 
                     { 
                         //... 
                         type: 'stackingcolumn', 
                     }, 
                    { 
                      //... 
                      yAxisName: 'yAxis', 
                      type:"spline"  
                    }, 
            ], 
});           

Screenshot: 
 

Sample for reference can be find from below link. 

Thanks, 
Dharani. 


Loader.
Live Chat Icon For mobile
Up arrow icon