Reputation: 741
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:
Upvotes: 1
Views: 413
Reputation: 51
You can add in vAxis attribute in options, the following key value pair:
textPosition: 'none'
Upvotes: 1