Chart.js legend took up too much spaces

后端 未结 5 2028
执笔经年
执笔经年 2020-12-10 15:27

I was having some problem with chart.js legend. The legend with long text took up too much spaces which resulting in the reduce in the size of my pie chart:

Another

5条回答
  •  爱一瞬间的悲伤
    2020-12-10 16:04

    Long legend nowrap is a known issue check https://github.com/chartjs/Chart.js/issues/3641

    May be they can cover it in next releases. For now the solution is to remove the native legend and draw your custom one

    I've created this plunk as an example for doghnut chart with custom legend https://embed.plnkr.co/5nuGS2KEV6hvESwGrOse/

提交回复
热议问题