Highcharts Demo

author(s): Torstein Hønsi

by Geo George

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
<button id="button">update black series index</button>

JavaScript

$(function() {
  var chart = Highcharts.chart('container', {
    chart: {
      type: 'bar'
    },
    plotOptions: {
      series: {
        stacking: 'percent',
        dataLabels:{
        enabled:true,
        shadow: false
        }
      }
    },
    series: [{
    name:"a",
      data: [1, 2, 3, 4, 5, 4],
      index: 1
    }, {
    name:"b",
      data: [6, 4, 5, 6, 7, 4],
      index: 0,
     // id: 's2'
    }]
  });

  $('#button').click(function() {
		chart.get('s2').update({index: 0});
  });
});