This is a migrated thread and some comments may be shown as answers.

Different dataSource filter for each series

0 Answers 49 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Cody
Top achievements
Rank 1
Cody asked on 20 Aug 2012, 10:23 PM
I'm having an issue with binding a json file to my chart. I am attempting to have a multi axes chart with stacked and grouped columns. I have it working with static data but cannot get it to work with the dataSource json file. I believe I need to be able to filter the datasource differently for each series. I've included a sample of the function, am I going about this wrong?

$("#ApplesOrangesChart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
datasource: {
transport: {
read:  "testjson.json",
},
sort: {
field: "MonthNumber",
dir: "asc"
},
},
title: {
text: "Apples to Oranges 2011 vs 2012",
},
legend: {
visible: true,
position: "bottom",
},
seriesDefaults: {
type: "column",
},
series: [{
name: "2011 Apples",
stack: "2011",
axis: "monthly",
field: "AppleValue",
filter: { field: "Year", operator: "eq", value: 2011 },
}, {
name: "2011 Oranges",
stack: "2011",
axis: "monthly",
field: "OrangeValue",
filter: { field: "Year", operator: "eq", value: 2011 },
}, {
name: "2012 Apples",
stack: "2012",
axis: "monthly",
field: "AppleValue",
filter: { field: "Year", operator: "eq", value: 2012 },
}, {
name: "2012 Oranges",
stack: "2012",
axis: "monthly",
field: "OrangeValue",
filter: { field: "Year", operator: "eq", value: 2012 },
},{
type: "line",
axis: "cumulative",
field: "CumlativeValue",
filter: { field: "Year", operator: "eq", value: 2011 },
name: "2011 Cumulative",
}, {
type: "line",
axis: "cumulative",
field: "WonCumlativeValue",
filter: { field: "Year", operator: "eq", value: 2012 },
name: "2012 Cumulative",
}],
valueAxis: [{
name: "monthly",
title: {text: "Monthly"},
labels: {
template: "#= kendo.format('{0:N0}', value / 1000) # M"
},
},
{
name: "cumulative",
title: {text: "Cumulative"},
labels: {
format: "C"
},
}],
categoryAxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"],
majorGridLines: {
visible: false
},
},
});

No answers yet. Maybe you can help?

Tags
Data Source
Asked by
Cody
Top achievements
Rank 1
Share this question
or