0

I am trying to make a graph with data on a public company's market cap over time. The numbers are in 12figures. So it seems that when using those numbers the chart.js can't draw a graph. My browser just crashes. I tried dividing the number to be displayed as millions and then it works. But that is not a solution because some companies have numbers that are smaller or might be small one year and than in billions other year.

Does anyone know if it is something in configuration I have to adjust or it is simply not possible in chart.js?

Note: I am using React as framework.

1 Answers1

0

You can abbreviate the numbers (i.e. 12bn instead of 12,000,000,000). See here: https://gist.github.com/tobyjsullivan/96d37ca0216adee20fa95fe1c3eb56ac

yes
  • 177
  • 9
  • Thanks for responding, but unfortunately it doesn't solve my issue. As I mentioned in some cases number might go down to one digit. In that case I would have issue that it is a just a small number compared to a million or billion. Doesn't make sense. – Kristina Durant May 29 '21 at 22:30
  • consider using a log scale on the y axis then? That would be a normal solution for this type of viz problem – yes May 30 '21 at 16:57