I have strange problem when aggregating my sale data by Location and displaying it on the chart by date.I have let's say 25 Sales Amount in two locations across different dates. Location A has 10 days when minimum 1 sale happened, location B has 15 days. I want to display line graph for last month for those two locations displaying the day and the amount of the sale. The days with no sale should just interpolate.The expected result is two lines each with different days and different amount. But What I get is two lines but( each with 9 dates) always paired together. It displays incorrect day and the amount of the sale that day. The data from the server are however correct , and so is correct the graph if only one location is displayed.The problem seems to be when the two lines have different dates.here is the relevant code:
function
makeChartData(transport, field){
var
chart_data =
new
kendo.data.DataSource({
transport: transport,
group: {
field: field
}
});
return
chart_data;
}
var
chart_data = makeChartData(transport,
"Location_Name"
);
function
createSalesChart() {
return
$(
"#overview-chart"
).height(400).width(490).kendoChart({
dataSource: chart_data,
autoBind:
false
,
seriesDefaults: { type:
"line"
, stack:
false
, missingValues:
"interpolate"
},
series: [
{
field:
"Gross_Total"
,
name:
"Gross Total"
,
categoryField:
"Date"
}
],
categoryAxis: {
field:
"Date"
,
baseUnit:
"days"
,
type:
"date"
,
labels: {
dateFormats: {
days:
"M-d"
},
step: 7
},
},
valueAxis: {
name:
"currency"
,
labels: { format: currency_prefix+
"{0}"
+currency_suffix },
},
legend: { position:
"bottom"
},
tooltip: { visible:
true
, format:
"0"
},
plotArea:{
background:
"#FFF"
}
});
}