I already have the percentage for my data, I just need to append the % to each data value.
I’m very new to JS and programming in general, so please be nice.
const Votes1 = document.getElementById("Votes1");
new Chart(Votes1, {
type: "bar",
reverse: "true",
data: {
labels: [
"African National Congress", "Other", "IFP", "National Party"
],
datasets: [
{
label: "Voting results from 1994 South African election.",
data: [62.25/45, 6.42, 10.54, 20.39],
backgroundColor: ["#627b88ff"],
borderWidth: 1,
},
],
},
options: {
indexAxis: "y",
scales: {
y: {
beginAtZero: true,
grid: {
drawOnChartArea: false,
},
},
x: {
beginAtZero: true,
grid: {
drawOnChartArea: false,
},
},
},
},
});
I’ve tried using Youtube videos for help, as well as some documentation – but I’m struggling since those are meant to extract data and THEN add the %. I just need to be able to add special characters to my Chart.js Data
If it matters, I’m using a tachyons framework
New contributor