Javascript 谷歌图表vAxis

Javascript 谷歌图表vAxis,javascript,charts,google-visualization,Javascript,Charts,Google Visualization,我在对象变量中使用组合图google在一个位置构建图形并显示,我为每个图表设置颜色和名称: vAxes: { 0: { title:'График 1', textStyle: {color: '#21C40A'}, minorGridlines: {count: 2, color: '#ccc'}, titleTextStyle: {color: '#21C40A'}, }, 1: { ti

我在对象变量中使用组合图google在一个位置构建图形并显示,我为每个图表设置颜色和名称:

vAxes: {
    0: {
        title:'График 1',
        textStyle: {color: '#21C40A'},
        minorGridlines: {count: 2, color: '#ccc'},
        titleTextStyle: {color: '#21C40A'},
    },
    1: {
        title:'График 2',
        textStyle: {color: '#E89712'},
        minorGridlines: {count: 2, color: '#ccc'},
        titleTextStyle: {color: '#E89712'}
    },
    2: {
        title:'График 3',
        textStyle: {color: '#390983'},
        minorGridlines: {count: 2, color: '#ccc'},
        titleTextStyle: {color: '#390983'}
    }
}
问题是,如何指定y坐标的位置或彼此之间的距离,以便数据不会彼此堆叠? 我可以这样拿吗?

在右侧轴之一上,
设置-->
textPosition:'in'

这将在图表中移动一个,否则,
它们总是叠在一起

请参阅以下工作片段,
还可以使用
chartArea.right
为标签和标题留出足够的空间

google.charts.load('current'{
回调:函数(){
var data=new google.visualization.DataTable();
data.addColumn(“日期”、“月份”);
data.addColumn('数字',“平均温度”);
data.addColumn('数字',“平均日照时数”);
data.addColumn('number','Average 1');
data.addColumn('数字',“平均值2”)
data.addRows([
[新日期(2014,0),-5,8.7,7,11],
[新日期(2014年1月1日),.4,8.7,5,12],
[新日期(2014年2月5日、12日、6日、13日],
[新日期(2014年3月2日)、9月2日、7月15日、5月14日],
[新日期(2014年4月)、6.3、18.6、8、15],
[新日期(2014年5月9日、20.9日、8日、16日],
[新日期(2014年6月)、10.6、19.8、9、16],
[新日期(2014年7月),10.3,16.6,7,15],
[新日期(2014年8月),7.4,13.3,8,14],
[新日期(2014年9月)、4.4、9.9、12、13],
[新日期(2014年10月)、1.1、6.6、11、12],
[新日期(2014年11月11日)-.2,4.5,11,11]
]);
变量分类={
标题:“冰岛全年平均温度和日照”,
宽度:“100%”,
高度:“100%”,
图表区:{
宽度:“100%”,
高度:“100%”,
前72名,
左:60,,
底图:48,
右:84
},
系列:{
0:{targetAxisIndex:0},
1:{targetAxisIndex:1},
2:{targetAxisIndex:2}
},
阀门:{
0: {
textPosition:'输出',
标题:“温度(摄氏度)”
},
1: {
textPosition:'输出',
标题:“日光”,
视图窗口:{
最多:30
}
},
2: {
textPosition:'在',
标题:"第三",,
视图窗口:{
最高:40
}
}
},
哈克斯:{
滴答声:[
新日期(2014,0)、新日期(2014,1)、新日期(2014,2)、新日期(2014,3),
新日期(2014年4月)、新日期(2014年5月)、新日期(2014年6月)、新日期(2014年7月),
新日期(2014年8月)、新日期(2014年9月)、新日期(2014年10月)、新日期(2014年11月)
]
},
};
var classicChart=new google.visualization.LineChart(document.getElementById('chart_div'));
classicChart.draw(数据、分类);
},
软件包:['corechart']
});
html,主体,div{
身高:100%;
}


对不起!更新的问题不要相信通过标准配置选项可以做到这一点——首先要考虑的是使用多个并排的图表,只在前两个图表上显示axis。如果它们为您提供对
textPosition
的显式控制,而不是“in”、“out”、“none”,那么这一切都会容易得多。即,左/右像素位置,可以让您堆叠任意数量的轴。