I want to create a Google line chart to display temperature, humidity and air pressure all in one chart.
Because of that there should be 3 y-axes with different ranges.
The problem is that the second and third y-axis somehow overlap.
I have only seen examples with two y-axes so far. Is triple y-axes possible at all? Would it help if I chose material opposed to the classic variant?
My chart setup is here:
new google.visualization.LineChart(document.getElementById('visualization'))
.draw(data, {
vAxes : [ {
title : 'Title 1',
minValue : 0,
maxValue : 20
}, {
title : 'Title 2',
minValue : 40,
maxValue : 80
}, {
title : 'Title 3',
minValue : 950,
maxValue : 1050
} ],
series : {
0 : {
targetAxisIndex : 0
},
1 : {
targetAxisIndex : 1
},
2 : {
targetAxisIndex : 2
}
},
});
The fiddle is here:
I could cheat to make the axes visible by moving (
textPosition
) one of themin
and the other oneout
:Updated fiddle: https://jsfiddle.net/1b3hd0ya/3/
you've got the right idea...
only other thing you might consider would be giving the right side a little more room to work with,
e.g.
chartArea.right
the material chart does a better job of spacing multiple axis labels,
but there are far fewer options to work with...
see following working snippet, which draws both...