change plotBackGroundColor dynamically if value exceeds a maximum value in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

change plotBackGroundColor dynamically if value exceeds a maximum value in 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 () {//from   w  ww  .  j  av  a 2 s. c o m
    $('#container').highcharts({
        title: {
            text: 'Tempratures'
        },
        xAxis: {
            type: 'datetime'
        },
        series: [{
            name: 'Temperature',
             threshold : 45,
            type: 'spline',
            data: [20.4, 30.2, 40.0, 47.2, 49.3, 52.5, 46.4, 41.3, 38.1, 30.9, 29.1, 28.0,20.4, 30.2, 38.0, 47.2, 49.3, 47.5, 42.4, 40.3, 32.1, 30.9, 39.1, 38.0],
            pointStart: Date.UTC(2010, 0),
            pointInterval: 31 * 24 * 36e5,
            color: '#FF0000',
            negativeColor: '#7cb5ec'
        } ]
    });
});

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

Related Tutorials