i have a problem in making a bubble chart with 3 bubbles, using ChartJS. it always shows one bubble instead of 3, tried to use push() and json, also failed.
someone can help? thanks in advance!!!
Page Code:
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w(“#dataset1”).onReady(() => {
wixData.query(“collegedetails”)
.ascending(“ranking”)
.limit(3)
.find()
.then((results) => {
console.log(results.items)
for ( var i = 0; i <= results.length; i++) {
let number = [{ x:results.items[i].ranking, y: results.items[i].studentnumber, r:results.items[i].acceptancerate*100}];
let name = results.items[i].schoolname;
console.log(number);
console.log(name);
let info = {data:number,label:name};
$w("#html1").postMessage(info);
$w("#html1").onMessage((event)=>{
if (event.data.type === ‘ready’){
$w(“#html1”).postMessage(info);
}
})
}
} )
})
})
HTML Code
Title