Deven
Deven

Reputation: 741

Hide/Remove y ticks in google charts

I am using below code to generate line graph using google charts

        google.charts.load('current', {packages: ['corechart', 'line']});
        google.charts.setOnLoadCallback(drawBasic);
        function drawBasic() {

              var data = new google.visualization.DataTable();
              data.addColumn('number', 'X');
              data.addColumn('number', 'T');
              for (var i=0;i<daily_json.hourly.data.length;i++){
                data.addRows([[i,daily_json.hourly.data[i].temperature]]);
              }

              var options = { hAxis: {title: 'Time',  gridlines:'grey'}, 
                            vAxis: {title: 'Temperature', baseline:'black', 
                            gridlines:'grey'}, width: 600,height: 300};

              var chart = new google.visualization.LineChart(document.getElementById('temp_chart'));
              chart.draw(data, options);
        }

However, I am unable to find a way to hide y axis ticks (60,70,80,90 in this case) and the plot I am getting currently is like this: enter image description here

Upvotes: 1

Views: 413

Answers (1)

BERT
BERT

Reputation: 51

You can add in vAxis attribute in options, the following key value pair:

textPosition: 'none'

Upvotes: 1

Related Questions