Chart.js在Doghnut图表上永久显示图标作为数据标签

时间:2020-01-09 10:52:35

标签: javascript chart.js

我正在使用chart.js的doghnut。我想在doghnut的片段上显示图标,如下图所示

enter image description here

我为标签添加了以下代码,但仅对文本添加了

plugins: {
          datalabels: {
            color: '#111',
            textAlign: 'center',
            font: {
              lineHeight: 1.6
            },
            formatter: function(value, ctx) {
              return '<p>My Paragrpah</p>\ndf';
    }
  }
}

图标显示在Doghnut的象限上。任何帮助表示赞赏。

0 个答案:

没有答案