How can I cause a legend to appear to the right of the pie (Chart.JS)?

前端 未结 2 1173
盖世英雄少女心
盖世英雄少女心 2021-01-27 19:26

I\'m creating a fairly simple pie chart with Chart.JS like so:

var data = {
    labels: [
        \"Bananas (18%)\",
        \"Lettuce, Romaine (14%)\",
                 


        
2条回答
  •  花落未央
    2021-01-27 19:48

    Another way to right align the legend is to add:

    legend: {
       position:"right"
    }
    

    To the Chart options

    JSfiddle

提交回复
热议问题