Hi - I'm trying to create a Scatter Chart bound to remote data, and grouped. I'm not getting something right. Attached is a screen shot that shows the data I'm getting from my JSON call, what the chart currently looks like(note the series name, something is wrong with where I am doing my grouping) and an example of a chart I'm working from.
I have looked at the demos for the scatter chart, I'm just not seeing what I'm missing.
Thanks - here is the code that creates the chart:
Thanks - Lisa
I have looked at the demos for the scatter chart, I'm just not seeing what I'm missing.
Thanks - here is the code that creates the chart:
//Crosstab
kcSchoolCrosstab = $(
"#SchoolCrosstab"
).kendoChart({
title: {
text:
"Crosstab"
,
font:
"bold 16px Arial,Helvetica,Sans-Serif"
},
legend: {
visible:
false
},
dataSource: {
transport: {
read:
function
(options) {
if
(!(ktvSchoolFilter && ktvSchoolFilter.getSelectedSchoolCodes() && getSelectedSchoolYear())) {
options.success([]);
return
;
}
kendo.ui.progress(kcSchoolCrosstab.element,
true
);
$.getJSON(Helpers.toServicesUrl(
"/GetEWSSchoolCountVsRiskScore"
),
{
username: WSIPCContext.UserName,
districtId: WSIPCContext.DistrictId,
schoolCodes: ktvSchoolFilter.getSelectedSchoolCodes(),
schoolYear: getSelectedSchoolYear,
// countOfEvents: 3,
countOfEvents: getRiskCatCount(),
whereIds:
"1"
}).success(
function
(data) {
options.success([]);
kcSchoolCrosstab.dataSource.data(data.GetEWSSchoolCountVsRiskScoreResult.RootResults);
}).always(
function
() {
kendo.ui.progress(kcSchoolCrosstab.element,
false
);
});
},
group: {
field:
"GradeLevel"
},
sort: {
field:
"StudentCount"
}
}
},
series: [{
type:
"scatter"
,
xField:
"StudentRiskFactor"
,
yField:
'StudentCount'
,
color:
"#4F82BE"
,
name:
"#= group.value"
}],
legend: {
position:
"bottom"
},
xAxis: {
labels: {
step: 2,
format:
"{0}%"
},
title: {
text:
"Avg. School Risk Score"
}
},
yAxis: {
labels: {
skip: 2,
step: 2
},
title: {
text:
"Avg. School Count"
,
margin: {
right: 10
}
}
},
chartArea: {
height: 300,
width: 520
}
}).data(
"kendoChart"
)
Thanks - Lisa