I am having a problem in making a doughnut chart. The data and label are sent from page code to html iframe…Both the data and labels are returned json data from another api…
Here i have taken (res.length-30) to decrease the data, to clarify if this is a problem with background color.
Note: res.length contains 38 items.
$w.onReady( function () {
getchampionranks('pronil07').then(res => {
console.log(res);
var data = ;
var labels = ;
for ( var i = 0; i <= res.length-30; i++) {
data.push(res[i].Minutes.toString());
labels.push(res[i].champion.toString());
}
console.log(data);
console.log("Data length: " + data.length);
console.log(labels);
console.log("Label length: " + labels.length);
$w("#html1").postMessage(data);
$w("#html1").onMessage((event) => {
if (event.data.type === ‘ready’) {
$w("#html1").postMessage(data);
}
});
$w("#html1").postMessage(labels);
$w("#html1").onMessage((event) => {
if (event.labels.type === ‘ready’) {
$w("#html1").postMessage(labels);
}
});
});
});
This is the html code…
TitleFor some reason the chart is not generating…Anyone please HALLLP…