0
我有一個amChart 3 AmGraph。我需要以編程方式啓用/禁用圖形。我希望所有圖形都可用,但其中一個禁用,只有當用戶單擊顯示圖形的相對標籤時。amCharts設置圖例標籤選擇/未選擇編程
可能嗎?
我有一個amChart 3 AmGraph。我需要以編程方式啓用/禁用圖形。我希望所有圖形都可用,但其中一個禁用,只有當用戶單擊顯示圖形的相對標籤時。amCharts設置圖例標籤選擇/未選擇編程
可能嗎?
要禁用圖表加載上的圖表,請在圖表配置中將其設置爲hidden
屬性爲true
。
即:
"graphs": [{
// ...
"hidden": true
}, ...]
要通過API,當圖表已經內置禁用的曲線圖,使用hideGraph()
方法。
即:
function hideGraphByIndex(index) {
chart.hideGraph(chart.graphs[ index ]);
}
function hideGraphById(id) {
chart.hideGraph(chart.getGraphById(id));
}