search

Home  >  Q&A  >  body text

Chartjs response size

I want to adjust the font size when my character width is smaller. I'm using ChartJs and Line type. When the canvas width is 100% (1500px) I have this: But when I change the canvas size to 50% (750px) I get the following result:

The text is too small to read, I want the font size not to change. Can this be done?

P粉321584263P粉321584263438 days ago575

reply all(1)I'll reply

  • P粉392861047

    P粉3928610472023-09-16 09:32:34

    Add the font size in the chart configuration and that's it.

    var options = {
       scales: {
        x: {
            ticks: {
                font: {
                    size: 12,
                }
            }
         }
       }
    };

    reply
    0
  • Cancelreply