give for each column a color for column range chart - Javascript highcharts

Javascript examples for highcharts:Column Chart

Description

give for each column a color for column range chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <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 ww  .j  av  a 2 s . c  om
    $('#container').highcharts({
        chart: {
            type: 'columnrange'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            type: 'category',
            labels: {
                rotation: -60,
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        },
        yAxis: {
            min: 0,
            max: 1000
        },
         plotOptions: {
            columnrange: {
                pointWidth: 2.5
            }
        },
        series: [{
            color: 'black',
            data: [
                [50, 71.5],
                [100, 329.2],
                {low:150, high:300, status:2, color:'red'},
                [245, 600.5],
                [300, 594.1],
                [20, 54.4],
                {low:500, high:777.4, status:2, colro:'red'},
                [434, 600.4],
                [80, 150.4],
                [222.2, 348.4],
                [323.3, 879.4],
                [80, 800]],
        },{
            type: "scatter",
            data: [['Jan',100],['Feb',200],['Mar',40],['Apr',109],['May',45],['Jun',180]]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/highcharts-more.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials