Jquery

How to add total count in centre of the doughnut chart and bottom left and right value using Chart.js?

50 views Asked by At

HTML

<canvas id="myChart" style="width:100%;max-width:600px"></canvas>

Jquery

<script>
    const cValues = ["Candidate quotas", "Reserved seats", "Countries"];
    const dValues = [66, 19, 85];
    const barColor = [
      "#C3DED1",
      "#F1CAE1",
      "#D26CA9"
    ];
    new Chart("myChart", {
      type: "doughnut",
      data: {
        labels: cValues,
        datasets: [{
          backgroundColor: barColor,
          data: dValues
        }]
      },
      options: {
        title: {
          display: true,
          text: "Quota information"
        }
      }
    });
</script>

I want to place the text Countries values at the center of the chart js donut charts, and rest value left and right, I don't know how to do that, I checked the chart js official docs, but they didn't provide any information about this, how can I achieve this.

Expacted result

[Expacting design image][2]

0

There are 0 answers