How to readjust the label of a Chart js chart?

Asked

Viewed 419 times

0

How do I adjust the font size of the label or place a line break? The text is not fitting in full, for monitor 1080 fits, but 720 happens this.

Como ajusto o tamanho da fonte do label ou coloco uma quebra de linha?

My code:

<script>
    var myChartcaixa = new Chart(document.getElementById("caixa-chart"), {
        type: 'pie',
        data: {
            labels:  @Html.Raw(Json.Encode(Model.Select(x => x.Descricao).ToArray())),
            datasets: [{
                data:  @Html.Raw(Json.Encode(Model.Select(x => x.Valor).ToArray())),
                backgroundColor: backgroudColor,
                borderWidth: 1,
            }]
        },
        options: {
            legend: false,
        }
    }); </script>
  • Even taking a few columns from the table the Chart label does not leave the Chart area itself, even though it has space to the right so that the phrase fits it keeps being cut.

  • Inspect the element and see what it addresses, put in css the property word-wrap: break-word

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.