Chart.js - Styling Legend

后端 未结 5 887
耶瑟儿~
耶瑟儿~ 2021-01-07 17:29

I\'m making a chart with chart.js and I\'m trying to figure out how I can change the label/legend styling. I want to remove the rectangle part and instead use a circle. I\'v

5条回答
  •  旧巷少年郎
    2021-01-07 17:50

    Additional information on @GRUNT 's answer I assign usePointStyle inside legend.labels not what @GRUNT did Chart.defaults.global.legend.labels.usePointStyle = true;

    This is useful when you are using react

    legend: {
        labels: {
          usePointStyle: true,
        },
      }
    

    more info here Display point style on legend in chart.js

提交回复
热议问题