javascript - Flot multiple stacked series in one chart -


is possible have 2 separate data variables stacked separately on same chart? example, first data variable has 3 stacked series in , second data variable has 2 different stacked series in it. can have both of them in same chart, stacked independently?

not sure understand, if want 2 groups of stacks, separate them out on x-axis:

    var d1 = [];     (var = 0; <= 10; += 1) {         d1.push([i, parseint(math.random() * 30)]);     }      var d2 = [];     (i = 0; <= 10; += 1) {         d2.push([i, parseint(math.random() * 30)]);     }      var d3 = [];     (i = 0; <= 10; += 1) {         d3.push([i, parseint(math.random() * 30)]);     }      // d1, d2, d3 run 0 10     // d4, d5, 12 20      var d4 = [];     (i = 12; <= 20; += 1) {         d4.push([i, parseint(math.random() * 30)]);     }             var d5 = [];     (i = 12; <= 20; += 1) {         d5.push([i, parseint(math.random() * 30)]);     } 

produces (example here):

enter image description here

edit comments

if want stack series in positive direction , others in negative, provide unique stack variable value each stack group.

    var d1 = [];     (var = 0; <= 10; += 1) {         d1.push([i, parseint(math.random() * 30)]);     }     d1 = {data: d1, stack: 1}; // specifiy unique stack pos      var d2 = [];     (i = 0; <= 10; += 1) {         d2.push([i, parseint(math.random() * 30)]);     }     d2 = {data: d2, stack: 1}; // specifiy unique stack pos      var d3 = [];     (i = 0; <= 10; += 1) {         d3.push([i, parseint(math.random() * 30)]);     }     d3 = {data: d3, stack: 1}; // specifiy unique stack pos      var d4 = [];     (i = 0; <= 10; += 1) {         d4.push([i, parseint(-math.random() * 30)]);     }     d4 = {data: d4, stack: 2}; // specifiy unique stack neg       var d5 = [];     (i = 0; <= 10; += 1) {         d5.push([i, parseint(-math.random() * 30)]);     }     d5 = {data: d5, stack: 2}; // specifiy unique stack neg 

updated example.

enter image description here


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -