首页 > 解决方案 > 如何解决 ChartJS 甜甜圈选项中的语法错误?

问题描述

我正在尝试(努力)根据需要自定义 ChartJS donought。每当我插入cutoutPercentage: 70选项时,我都会收到来自 JSlint 的语法错误。

无论我在哪个位置插入选项,它都不起作用。如果我只插入cutoutPercentage: 70没有legend and tooltip options它就可以了……但不能组合使用。

在职的:

      options:{
         legend: {
            display: false
         },
         tooltips: {
            enabled: true
         }
       }

工作以及

     options: {
       cutoutPercentage: 70
              }

不工作:

      options:{
         legend: {
            display: false
         },
         tooltips: {
            enabled: true
         }
         cutoutPercentage: 70              
       }

标签: javascriptchart.js

解决方案


推荐阅读