我有带有多值轴和剑道树视图的剑道图表。我想根据复选框选择显示值轴。例如,我们将选中“KM”复选框,然后图表将显示 KM 值轴。
可能吗?
这是我的图表代码:
function createChart() {
$("#chart").kendoChart({
legend: {
position: "top"
},
series: [{
type: "column",
data: [20, 40, 45, 30, 50],
stack: true,
name: "on battery",
color: "#003c72"
}, {
type: "column",
data: [20, 30, 35, 35, 40],
stack: true,
name: "on gas",
color: "#0399d4"
}, {
type: "area",
data: [30, 38, 40, 32, 42],
name: "mpg",
color: "#642381",
axis: "mpg"
}, {
type: "area",
data: [7.8, 6.2, 5.9, 7.4, 5.6],
name: "l/100 km",
color: "#e5388a",
axis: "l100km"
}],
valueAxes: [{
title: { text: "miles" },
min: 0,
max: 100
}, {
name: "km",
title: { text: "km" },
min: 0,
max: 161,
majorUnit: 32
}, {
name: "mpg",
title: { text: "miles per gallon" },
color: "#642381"
}, {
name: "l100km",
title: { text: "liters per 100km" },
color: "#e5388a"
}],
categoryAxis: {
categories: ["Mon", "Tue", "Wed", "Thu", "Fri"],
axisCrossingValues: [0, 0, 10, 10]
}
});
}
$(document).ready(function() {
setTimeout(function() {
createChart();
$("#example").bind("kendo:skinChange", function(e) {
createChart();
});
}, 400);
});
我的 jsbin:http: //jsbin.com/eyibar/4/edit