Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent my stacked series from being in reverse order?

Tags:

I tried an example of stacked series on JSFiddle but according to me, series are reversed when stacked:

$(function () {     $('#container').highcharts({         chart: {         },         xAxis: {             categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']         },          plotOptions: {             series: {                 stacking: 'normal'             }         },          series: [{             data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]         }, {             data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]         }]     }); }); 

The first line in blue should be drawn first (January : 29.9), and the second should be added to this one (January : 29.9 + 144 = 173.9 ).

Is there a way to get series in the right order when they are stacked?

like image 766
keskispas Avatar asked Apr 24 '13 07:04

keskispas


People also ask

How do I change the order of a stacked area chart in Excel?

Under Chart Tools, on the Design tab, in the Data group, click Select Data. In the Select Data Source dialog box, in the Legend Entries (Series) box, click the data series that you want to change the order of. Click the Move Up or Move Down arrows to move the data series to the position that you want.

How do I create a stacked bar chart in Excel?

Select the data that you want to display in the form of a chart. In the Insert tab, click Column Charts (in Charts section) and select “2-D stacked bar.” A chart appears, as shown in the following image. The stacked bar chart compares the sales revenue generated in different months with respect to time.


1 Answers

Since this was the top result in google, maybe this saves time for some:

The yAxis has a reversedStacks parameter (since version 3.0.10), which is true by default. To build stacks from bottom up, set this to false. Legend and shared tooltip item order remain correct this way.

http://jsfiddle.net/r5upptLo/

like image 151
lionel Avatar answered Oct 13 '22 01:10

lionel