I have some data that I want to display in a [Kendo UI Stacked Bar Chart](https://demos.telerik.com/kendo-ui/bar-charts/stacked-bar). I can see the data in the console and I can see what one of the data points is as well, but for some reason Kendo UI is unable to display the data.
Earlier I had dummy data as
series: [{
name: "test",
data: [100],
color: "#1FA8E0"
}, {
and the bar went to 100 as expected, so as far as I'm concerned I'm passing data in the correct location.
### JS snippet:
function _loadWODataSet() {
var curDate = new Date(),
_startDate = '1-1-' + curDate.getFullYear(),
_endDate = curDate.getMonth() + '/' +
curDate.getDate() + '/' +
curDate.getFullYear();
GetHSClassData("ClassHere",
"WOffAmt, WUWDAmt",
"@DISTINCT and WorkDate >= '" + _startDate +
"' and WorkDate <= '" + _endDate + "'",
"", function(results) {
createWOChart(results);
});
}
function createWOChart(payload) {
$("div[report='wo-report']").kendoChart({
title: {
text: "WO-Title"
},
seriesDefaults: {
type: "column",
stack: true
},
chartArea: {
width: 200,
height: 500
},
series: [{
name: "WOffAmt",
data: payload[0].woffamt,
color: "#1FA8E0"
}, {
name: "WUWDAmt",
data: payload[0].wuwdamt,
color: "#473F38"
}],
valueAxis: {
min: -2000,
max: 2000,
majorUnit: 1000,
line: {
visible: false
},
minorGridLines: {
visible: false
}
},
categoryAxis: {
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});
console.log(payload);
console.log(payload[0].woffamt); // -1100
}
### Elsewhere in JS, before the above code:
function _loadDatasets(){
// irrelevant code here
JSON.parse(sessionStorage.getItem('dsPYMTD'))[0].Error){
_getCFDataset();
_loadW0DataSet();
}
loadCount = 0;
_detectDatasets();
}
### Other JS file: https://jsfiddle.net/tx0z43fn/
### Console screenshot: https://i.stack.imgur.com/AUSJo.png
Earlier I had dummy data as
series: [{
name: "test",
data: [100],
color: "#1FA8E0"
}, {
and the bar went to 100 as expected, so as far as I'm concerned I'm passing data in the correct location.
### JS snippet:
function _loadWODataSet() {
var curDate = new Date(),
_startDate = '1-1-' + curDate.getFullYear(),
_endDate = curDate.getMonth() + '/' +
curDate.getDate() + '/' +
curDate.getFullYear();
GetHSClassData("ClassHere",
"WOffAmt, WUWDAmt",
"@DISTINCT and WorkDate >= '" + _startDate +
"' and WorkDate <= '" + _endDate + "'",
"", function(results) {
createWOChart(results);
});
}
function createWOChart(payload) {
$("div[report='wo-report']").kendoChart({
title: {
text: "WO-Title"
},
seriesDefaults: {
type: "column",
stack: true
},
chartArea: {
width: 200,
height: 500
},
series: [{
name: "WOffAmt",
data: payload[0].woffamt,
color: "#1FA8E0"
}, {
name: "WUWDAmt",
data: payload[0].wuwdamt,
color: "#473F38"
}],
valueAxis: {
min: -2000,
max: 2000,
majorUnit: 1000,
line: {
visible: false
},
minorGridLines: {
visible: false
}
},
categoryAxis: {
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});
console.log(payload);
console.log(payload[0].woffamt); // -1100
}
### Elsewhere in JS, before the above code:
function _loadDatasets(){
// irrelevant code here
JSON.parse(sessionStorage.getItem('dsPYMTD'))[0].Error){
_getCFDataset();
_loadW0DataSet();
}
loadCount = 0;
_detectDatasets();
}
### Other JS file: https://jsfiddle.net/tx0z43fn/
### Console screenshot: https://i.stack.imgur.com/AUSJo.png