I have data like this
And here is my Json data format
[{ "Value1":"B95 ",
"Value2":1.2600,
"ChartType":"column",
"ChartDescription":"Fuel Sales Quantity",
"Value3":"2015-07-27",
"SeriesField":"Value2",
"CategoryField":"Value3",
"IsGroup":true,
"IsStacked":true,
"GroupValue":"Value1",
"SortValue":"Value3"},
{"Value1":"B93",
"Value2":8.2100,
"ChartType":"column",
"ChartDescription":"Fuel Sales Quantity",
"Value3":"2015-07-22",
"SeriesField":"Value2",
"CategoryField":"Value3",
"IsGroup":true,
"IsStacked":true,
"GroupValue":"Value1",
"SortValue":"Value3"}]
I just want to create a grouped stacked charts per day with kendo column charts
but when i draw this chart i have 6 unique day but chart show just 4 day
The chart example here...
Data mixed or shifting each other...
Here is my Javascript code
function createChart(number) {
$("#chart-" + number).kendoChart({
dataSource: myData,
title: {
text: title
},
legend: {
visible: true,
position: "bottom",
labels: {
template: '#: chartType == "pie" ? dataItem.Value1 : chartType == "donut" ? dataItem.Value1 : text #'
}
},
seriesDefaults: {
type: chartType,
stack: stackValue
},
series: series,
valueAxis: {
labels: {
format: "{0}"
}
},
categoryAxis: categories,
tooltip: {
visible: true,
format: "{0}",
template: "#= dataItem.Value1 #: #= kendo.format('{0:N}',value) #"
}
});
}
$(document).ready(function () {
$.ajax({
url: '../Dashboards/QuerySelected',
data: { id: number, from: fromdate, to: todate, fleet: fleetident },
success: function (data) {
if (data.length != 0) {
if (data[0].IsGroup) {
myData = {
data: data,
group:{
field: data[0].GroupValue
},
sort: {
field: data[0].SortValue,
dir: "asc"
}
}
}
else {
myData = data
}
series = [{
field: data[0].SeriesField
}];
categories = {
field: data[0].CategoryField
}
stackValue = data[0].IsStacked;
chartType = data[0].ChartType;
title = data[0].ChartDescription;
createChart(number);
}
}
});
}
Is it possible to my erroe on grouping or sorting on chart ?? How can i solve this problem Thanx Saul