2
``enter image description here我有一個折線圖的兩個圖表範圍過濾器。一個是日期和第二個是時間。首先我想從日期範圍過濾器中選擇日期,比我想要的其他圖表範圍滑塊相對於第一個滑塊的值更改。或者我可以如何設置圖表範圍過濾器的「hAxis」值。提前致謝 。更改Google圖表中的圖表範圍過濾器的值
var controll = new google.visualization.ControlWrapper({
controlType: 'ChartRangeFilter',
containerId: 'control_div1',
options: {
filterColumnIndex: 0,
ui: {
chartOptions: {
height: 50,
labelStacking: 'vertical',
chartArea: {
width: '80%',
},
'hAxis': { 'baselineColor': 'none', format: "dd MMM yyyy" }
}
}
},
state: {
range: {
start: new Date(2017, 5, 8, 20, 00, 00, 00),
end: new Date(2017, 5, 8, 20, 50, 00, 00)
//state: { lowValue: new Date(2017, 5, 5, 20, 00, 00, 00),
// highValue: new Date(2017, 5, 13, 20, 50, 00, 00) }
}
}
});
和第二控制包裝物以下對時間變化
var control = new google.visualization.ControlWrapper({
controlType: 'ChartRangeFilter',
containerId: 'control_div',
options: {
filterColumnIndex: 0,
ui: {
chartOptions: {
height: 50,
chartArea: {
width: '80%',
},
'hAxis': { 'baselineColor': 'none', format: " hh:mm:ss" }
}
}
},
});
哥哥三江源我找到了一種方法!接下來的事情我想知道我可以移動我的固定範圍滑塊,就像我可以在設置的間隔函數中使用它來模擬圖表。 –
使用上面顯示的'setState'方法來改變任何過濾器的範圍,只需確保之後重新繪製 - 您還可以在創建時通過添加一個'state'鍵來爲控件設置一個「默認範圍」類似「選項」... – WhiteHat
https://stackoverflow.com/questions/44703987/simulation-in-google-chart-by-moving-its-chart-range-slider-after-some-seconds這裏是鏈接我的下一個問題。請指導我 –