我有一个带有组字段的剑道图表,也有带有 3 个复选框的树视图。我想用复选框选中的事件过滤图表。但在我的应用程序中它不起作用。请任何人帮助我。我的图表代码是
$("#myChart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
dataSource: {
data: tmpData2,
sort: {
field: "date",
dir: "asc"
},
group: {
field: "close"
},
schema: {
model: {
fields: {
date: {
type: "date" }
}
}
}
},
title: {
text: "My Date-aware Chart"
},
legend: {
position: "bottom"
},
seriesDefaults: {
type: "line",
labels: {
visible: true
},
missingValues: "gap"
},
series: [{
name: "Close",
field: "closeA",
axis: "A"
},
{
name: "Close",
field: "closeb",
axis: "B"
},
{ name: "Close",
field: "closec",
axis: "B"
}],
valueAxis: [{
name: "A",
labels: {
format: "{0}%"
}
},
{
name: "B",
labels: {
format: "{0}D"
}
}],
categoryAxis: {
type: "Date",
field: "date",
axisCrossingValue: [0, 1000]
}
});
我的树视图代码是
$("#treeview").on("change", function (e) {
console.log("click", multi.text());
var selected = multi.text().split(",");
console.log("multi", selected);
var condition = {
logic : "or",
filters: [
]
};
$.each(selected, function (idx, elem) {
condition.filters.push({ field: " close", operator: "eq", value: elem.trim() });
});
mychart.dataSource.filter(condition);
});