-1

I have a bubble chart and want to put a number in bubbles. Is this even possible? Please see my code, there you can see what I expect. In the picture below is visible how it should looks like.

I hope this is possible and someone could give me a hint. THank you

public bubbleChartData: ChartDataSets[] = [
{
  data: [
    { x: 1, y: 2024, r: 20, /*content: 2*/ },
    { x: 1, y: 2024, r: 20, /*content: 4*/ },
    { x: 2, y: 2028, r: 20, /*content: 3*/ },
    { x: 5, y: 2025, r: 20, /*content: 1*/ },
  ]
}

];

It should looks like this:

enter image description here

Buzz
  • 315
  • 6
  • 18

1 Answers1

0

I believe chart.js has plugin for this: https://github.com/chartjs/chartjs-plugin-datalabels

It's also possible to add title: "dataTitle1" to your dataset. Example: https://jsfiddle.net/Nurech/Lphdakyx/2/

If you were to ask my opinion on charting libraries on Angular though I'd say chart.js (e.g ng-chart) is kind of weak with documentation and hard to configure. I would highly recommend moving to E-Charts if that's possible.

Joosep Parts
  • 5,372
  • 2
  • 8
  • 33