如何改变环形图的背景色

试了七八种方法,还是不能改变这个环形图的背景色,请高手指教!

<avue-progress :color="color"
                   :width="width"
                   :showText="false"
                   :strokeWidth="strokeWidth"
                   :percentage="dataChart.data"
                   :type="type">
    </avue-progress>

截屏2021-11-03 上午11.42.03.png

加了下面的⬇️代码,不管用

<style>
::v-deep .el-progress-circle__track {
  stroke: rgb(0, 255, 34);
}
</style>

使用的是avue

阅读 2.7k
1 个回答

我是这样解决的,封装了一下avue-progress,然后下了一个component为style的组件,这样就能覆盖样式了。

<avue-progress :color="color1" :width="width" :height="height" :showText="false" :strokeWidth="strokeWidth"
    :percentage="percentage" :type="type" :id="chartId">
</avue-progress>

<component :is="'style'"> 
    {{"#" + chartId}} .el-progress-circle svg path:nth-child(1) { 
        stroke: {{option.bgColor}};
    }
</component>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题