@jgreen721
Posted
I think rather than using the chart.js library, you can just map thru the data and create a new div element to act as your bar and create its height based upon the amount value and then just append that onto the page.
So something like
data.forEach((day) => { var chartDiv = document.createElement("div"); chartDiv.className = "chart-div"; chartDiv.style.height = day.amount * 2 + "px"; document.querySelector(".yourchart").append(chartDiv); })
Again, just an example...that appears to print out really awkward, grrr, lol but text editor should be able to clean it up.
Nice work though. It all looks good and there certainly no harm in getting some practice in with the chart lib!
Marked as helpful
@stephanniegb
Posted
@jgreen721 thanks I'll definitely try it out