I want to display some Data with googles Scatter Chart. No matter how I try I can't get the y axis labels to show.
I tried various things, which were suggested here and on other forums. Including: Resizing the chart, resizing the label font, Rescaling the axis and changing the textPosition of the vAxis. None of this worked.
The funny thing is that the ticks I defined are showing correctly placed gridlines. It is just the labels that are missing. The axis title is also displayed which leads me to the conclusion that spacing is not an issue. The code looks like this:
function getLineChartOptions(target,leaflayer,curretnStartDate,currentEndDate) {
var ymin = 0;
var ymax = 100;
var yticks = [];
if (target == "BBCH (BBCH)"){
yAxisTitle = "BBCH";
yticks = [0, 20, 40, 60, 80, 100];
}
else{
yAxisTitle = target +" "+leaflayer+" severity";
yticks = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
}
var mo={
title: yAxisTitle,
width: 800,
height: 400,
vAxis: {
viewWindow: {
min: ymin,
max: ymax
},
ticks: yticks,
title: yAxisTitle,
labels: yticks,
textStyle : { fontSize: 10}
},
hAxis: {
viewWindow: {
min: curretnStartDate,
max: currentEndDate
},
gridlines: {
count: 6,
}
},
tooltip: {isHtml: true, trigger: 'selection'},
legend: {position: 'none'},
colorAxis: {colors: ['green','yellow', 'red']},
focusTarget: 'category'
};
return mo
var materialOptions = getLineChartOptions(target,leaflayer,curretnStartPickedDate,enddatePickedDate);
var node = document.createElement('div');
var infoWindow = new google.maps.InfoWindow();
var chart = new google.visualization.ScatterChart(node);
chart.draw(Data, materialOptions);