【问题标题】:Chart.js PolarArea not able to chance arc width and colorChart.js PolarArea 无法改变弧宽和颜色
【发布时间】:2021-03-31 13:20:03
【问题描述】:

在 polarArea 图表中更改弧线的宽度不起作用。所有其他选项都做得很好。我错过了什么? 下面我有代码。

var chartOptions = {
  scale: {
    ticks: {
      beginAtZero: true,
      min: 0,
      max: 10,
      stepSize: 2
    },
    pointLabels: {
      fontSize: 16
    },
  },
  arc: {
    borderWidth: 4,
    borderColor: "green"
  },
};

【问题讨论】:

    标签: chart.js options


    【解决方案1】:

    您必须将 arc 对象放在元素部分,如下所示:

    options: {
        elements: {
            arc: {
                backgroundColor: 'red'
            }
        }
    }
    

    【讨论】:

    • 感谢您的回答,但不幸的是,这不是答案。同心圆必须是其他颜色和更厚。抱歉,这不是弧线。我的错。
    【解决方案2】:

    我找到了答案。

        scale: {
            lineWidth: 1,
              color: "#000000"
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2016-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-20
      • 2018-01-10
      • 2015-04-23
      • 1970-01-01
      相关资源
      最近更新 更多