Drawing Percent Line Chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Drawing Percent Line Chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function() {// w  w  w.j  ava  2s .  co  m
  $('#container').highcharts({
    xAxis: {
      minPadding: 0.05,
      maxPadding: 0.05
    },
    plotOptions: {
      series: {
        stacking: 'percent'
      }
    },
    tooltip: {
       valueSuffix: '%'
    },
    series: [{
      data: [
        ['A', 29.9],
        ['B', 71.5],
        ['C', 106.4]
      ],
      name: 'l1'
    }, {
      data: [
        ['A', 33.9],
        ['B', 22.5],
        ['C', 77.4]
      ],
      name: 'l2'
    }, {
      data: [
        ['A', 55.9],
        ['B', 21.5],
        ['C', 134.4]
      ],
      name: 'l3'
    }]
  });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container" style="height: 400px"></div>  
   </body>
</html>

Related Tutorials