简体   繁体   中英

Highcharts dynamic stacked area

I have an highcharts dynamic chart, I had it as a type spline and it would update dynamically fine, however when I switch too type: area and stacking: normal, the chart isn't getting stacked when it updates dynamically. On initial loading of the data the chart is fine, however when it does it after that, it just goes back to the odd charting type.

Maybe I need to set something extra for the area stack to work? Thanks ahead of time.

Probalbly in the plotOptiosn you has defined type of object which is stacked (ie column) so you need to replace it with series.

See example http://jsfiddle.net/4u9sn/

plotOptions: {
            series: {
                stacking: 'normal'
            }
        },

Update action

$('#update').click(function(){
            $.each(chart.series,function(i,serie){
                serie.update({
                    type:'area'
                });
            });
        });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM