I need the y axis labeled as "Project Count" and the x axis as "Installers" in this chart.js chart. Currently, I am using the h5 html tag for the x axis which is incorrect. I have included my chart.js javascript code below and also attached an image of the chart.js chart. Thank you in advance. Here is my code:
<div class="cardImage" style="width:97%;height:480px;margin-top:40px;margin-left:20px;margin-right:10px;">
<div class="columnChild child3" style="position: relative; height:32vh; width:80vw">
<canvas class="bubble" id="bubble" style="margin-left:10px;width:25px;height:10px;"></canvas>
</div>
<center>
<h5 style="color:black;margin-top:240px; margin-left:-100px;">Installers</h5>
</center>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
var bubbleBackgroundColor = function () {
return 'rgba(194, 106, 137, 0.8)'
};
var bubbleBorderColor = function () {
return 'rgba(243, 193, 28, 0.8)'
};
var bubbleData = {{ data['bubbleData'] | tojson }};
var bubbleCategory = {{ data["bubbleCategory"] | tojson }};
var colorBubbleHover = {{ data['colorBubbleHover'] | tojson }};
var pointBorderColor = {{ data['pointBorderColor'] | tojson }};
var bubbleChartData = {
animation: {
duration: 10
},
datasets: [{
label: "Customer Segment",
fill: true,
lineTension: 0.1,
backgroundColor: bubbleBackgroundColor(),
borderColor: bubbleBorderColor(),
borderCapStyle: 'butt',
borderDash: [],
borderDashOffset: 0.0,
borderJoinStyle: 'miter',
pointBorderColor: pointBorderColor, //"rgba(75,192,192,1)"
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHoverBackgroundColor: colorBubbleHover,
pointHoverBorderColor: "blue",
pointHoverBorderWidth: 2,
pointRadius: 1,
pointHitRadius: 10,
data: bubbleData,
}],
};
var ctx = document.getElementById('bubble');
var bubble = new Chart(ctx, {
type: 'bubble',
data: bubbleChartData,
options: {
responsive: true,
plugins: {
legend: {
display: false,
}
},
scales: {
x: {
type: 'category',
labels: bubbleCategory,
labelStrng: "Installers",
scaleLabel: {
display: true,
labelString: "Project Count",
fontStyle: 'bold',
fontColor: "black"
}
}
}
}
});
</script>
</div>
[My bubble Chart image][1] [1]: https://i.sstatic.net/LVZS4.png