Radial Gradient, for plot bands on a gauge chart? - Javascript highcharts

Javascript examples for highcharts:Gauge Chart

Description

Radial Gradient, for plot bands on a gauge 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  w  w.ja va 2s . c  o  m
  var chart = new Highcharts.Chart({
    chart: {
      renderTo: 'container',
      type: 'gauge'
    },
    pane: {
    },
    yAxis: {
      min: 0,
      max: 100,
      plotBands: [{ // mark the weekend
        color: {
          radialGradient: {
            cx: 0.5,
            cy: 0.5,
            r: 0.5
          },
          stops: [
            [0, '#000000'],
            [0.8, '#ffffff'],
            [1, '#000000'],
          ]
        },
        from: 0,
        to: 100,
        innerRadius: '90%',
        outerRadius: '110%'
      }],
    },
    plotOptions: {
      gauge: {
        dial: {
          radius: '100%',
          backgroundColor: 'silver',
          borderColor: 'black',
          borderWidth: 1,
          baseWidth: 10,
          topWidth: 1,
          baseLength: '90%', // of radius
          rearLength: '50%'
        }
      }
    },
    series: [{
      data: [80]
    }]
  });
});

      </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="width: 400px; height: 300px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials