Remove the value label from a Google Visualizations gauge Chart - Javascript Google Chart

Javascript examples for Google Chart:Gauge Chart

Description

Remove the value label from a Google Visualizations gauge Chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Google Gauge problem</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="http://code.jquery.com/jquery-2.2.2.js"></script> 
      <style id="compiled-css" type="text/css">

svg g g  {/*from w  w  w  .j a v  a2s  .  com*/
   font-size:10px;
}


      </style> 
      <script type="text/javascript">
    window.onload=function(){
google.charts.load('current', {packages: ['gauge']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
    var data = google.visualization.arrayToDataTable([
        ['Label', 'Value'],
        ['Value', {v:1, f:''}]]);
    var gauge_widget = document.getElementById('chart_div');
    var chart = new google.visualization.Gauge(gauge_widget);
    var options = {
        width: 300, height: 200,
        minorTicks: 10,
         'majorTicks': ["","", "20", "30", "40", "50",  "60"],
        max: 60
    };
    chart.draw(data, options);
    document.getElementById('gaugeBut').onclick = function () {
        data.setValue(0, 1, data.getValue(0, 1) + 1);
        chart.draw(data, options);
    };
}
    }

      </script> 
   </head> 
   <body> 
      <div id="chart_div"></div> 
      <br> 
      <br> 
      <form id="gaugeForm"> 
         <input type="button" id="gaugeBut" value="Increment"> 
      </form> 
      <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>  
   </body>
</html>

Related Tutorials