我目前正面臨谷歌圖表的一個問題,它看起來相當簡單。所有我需要的是刪除當前圖表的行程寬度:谷歌圖表設置折線圖的行程寬度爲空
,使它看起來像下面的圖表:
我所擁有的是一個堆積面積圖,所以選項設置如下:
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