简体   繁体   English

在quickchart js中更改进度条的边框颜色

[英]Change the border color of a progress bar in quickchart js

i'm using quickchart.js to create a progress bar and i have a problem.我正在使用quickchart.js创建进度条,但我遇到了问题。 When I create a progress bar by assigning it a background color it works but there is a permanent blue border that I can't remove.当我通过为其分配背景颜色来创建进度条时,它可以工作,但是有一个无法删除的永久蓝色边框。 Here the first example这里是第一个例子

I tried to change the color of the border but it does not change this border.我试图改变边框的颜色,但它不会改变这个边框。 Here the second example with border color这是带有边框颜色的第二个示例

{
  type: 'progressBar',
  data: {
    datasets: [{
      backgroundColor: '#32cd32',
      data: [50],
      datalabels: {
          font: {
              style: 'Arial',
              size: 18,
          }
      }
    }]
  }
}

Is there a possibility to remove this border or change its color?是否有可能删除此边框或更改其颜色?

You can define a second dataset that specifies the total (100%) of the progress bar.您可以定义第二个dataset来指定进度条的总数 (100%)。

In order to remove the border, this could look as follows:为了删除边框,这可能如下所示:

{
  type: 'progressBar',
  data: {
    datasets: [{
      backgroundColor: '#32cd32',
      data: [50]
    },
    {      
      borderColor: 'white',
      data: [100]
    }]
  }
}

Simply change borderColor in case you want a specific border to be drawn.如果您想要绘制特定的边框,只需更改borderColor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM