Columnrange to combine with a LINE for spline chart - Javascript highcharts

Javascript examples for highcharts:spline chart

Description

Columnrange to combine with a LINE for spline 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://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {// ww  w. j  a v  a  2  s.c om
   $('#container').highcharts({
       title: {
           text: 'Temperature variation by month'
       },
      subtitle: {
           text: 'Observed in Vik i Sogn, Norway, 2009'
       },
       xAxis: {
           categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            gridLineWidth: 0
       },
       yAxis: {
           title: {
               text: 'Temperature ( ?C )'
           },
            gridLineWidth: 0
       },
       tooltip: {
           valueSuffix: '?C'
       },
       plotOptions: {
           columnrange: {
              dataLabels: {
                 enabled: true,
                 formatter: function () {
                    return this.y + '?C';
                 }
              }
           }
       },
       legend: {
           enabled: true
       },
       series: [{
            type: 'columnrange',
           name: 'Temperatures',
           data: [
            [-9.7, 9.4],
            [-8.7, 6.5],
            [-3.5, 9.4],
            [-1.4, 19.9],
            [0.0, 22.6],
            [2.9, 29.5],
            [9.2, 30.7],
            [7.3, 26.5],
            [4.4, 18.0],
            [-3.1, 11.4],
            [-5.2, 10.4],
            [-13.5, 0.8]
         ]
       },
        {
            type: 'spline',
            name: 'Average',
            data: [3, 2.67, 3, 6.33, 3.33],
            marker: {
               lineWidth: 1,
            }
        }
                ]
   });
});

      </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