Solid gauge update

by kzoon

HTML

<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/solid-gauge.js"></script>
<div id="container" style="width: 500px; height: 300px;"></div>
<button id="opacity">Update</button>

JavaScript

Highcharts.chart('container', {


  "chart": {
    "type": "solidgauge"
  },
  "pane": {
    "size": "100%",
    "background": [{
      "backgroundColor": "rgba(237,125,49,1)",
      "borderWidth": 0,
      "innerRadius": "60%",
      "outerRadius": "100%",
      "shape": "arc"
    }]
  },
  "title": {
    "text": "",
    "margin": 0
  },

  "yAxis": [{
    "lineWidth": 0,
    "tickPositions": [],

  }],
  "series": [{
    "color": "rgba(68,114,196,1)",
    "innerRadius": "60%",
    "radius": "100%",
    "data": [62.7],
    "showInLegend": false
  }]


});

// Toggle names
$('#opacity').click(function() {
  chart.update({
    "pane": {
      "size": "100%",
      "background": [{
        "backgroundColor": "rgba(68,114,196,1)",
        "borderWidth": 0,
        "innerRadius": "60%",
        "outerRadius": "100%",
        "shape": "arc"
      }]
    }

  },);

  chart.redraw();

});