我目前正面临谷歌图表的一个问题,它看起来相当简单。所有我需要的是删除当前图表的行程宽度:谷歌图表设置折线图的行程宽度为空
,使它看起来像下面的图表:
我所拥有的是一个堆积面积图,所以选项设置如下:
var options = {
'title': '',
isStacked: true,
legend: {
textStyle: { fontSize: '16' },
position: 'top'
},
hAxis: {
title: '',
gridlines: {
color: '#000000', //Note: 'count: 4' attribute is only possible for continuous...so try to find a way for non-continuous h axis
},
textStyle: {
fontName: 'Arial',
fontSize: '18'
}
//ticks: [0, 100, 200, 75, 100] // display labels every 25
},
vAxis: {
title: '',
gridlines: {
color: '#D3D3D3',
count: 10,
//lineDashStyle: [2,2]
},
textStyle: {
fontName: 'Arial',
fontSize: '18'
},
viewWindow: { max: range_max, min: range_min } //TODO: make them generable
//showTextEvery: 100
},
'width': 1100, //100% //TODO: make this relative
'height': 600,
crosshair:
{
trigger: 'both'
},
series:
{
0: { pointSize: 8 },
3: { lineDashStyle: [5, 1, 3] },
4: { type: 'area', color: 'transparent'}, //visibleInLegend: false
5: { type: 'area', backgroundColor: { strokeWidth: 0 } } // color: 'transparent'
},
intervals: { 'style': 'line' },
colors: ['#ff0000', '#000000', '#0000ff', '#000000', '#000000', '#000000']
}
但是strokeWidth属性似乎并没有工作。有什么建议,我做错了请吗?
尝试使用样式列,看到[这个答案](http://stackoverflow.com/a/39410821/5090771) – WhiteHat
嗨@WhiteHat,谢谢你的回复。但是,这似乎只有当你有1个折线图时才起作用。在我的情况下,我有一个组合图,所以如果我以这种方式应用样式,它将影响所有其他图表。即如果我将样式设置为“stroke-width:none”,则在所有图表中都没有笔触宽度。我只希望影响上面屏幕截图中显示的那个。有关于此的任何建议吗? – Sambas23
不,一个样式栏只适用于它所遵循的系列栏,这是可能的与组合,我会添加一个答案来演示... – WhiteHat