fix : 饼图D3 背景颜色更改

This commit is contained in:
likexuan
2022-08-01 09:24:47 +08:00
parent b202643a27
commit fb8de2c3ee

View File

@@ -125,7 +125,7 @@ export default {
const showValue = chartDataFormat.getUnit(chartInfo.unit ? chartInfo.unit : 2).compute(value, null, -1, decimals)
const mapping = this.selectMapping(value, chartInfo.param.valueMapping, chartInfo.param.enable && this.chartInfo.param.enable.valueMapping)
const type = 'pie'
const color = this.colorList[colorIndex]
const color = mapping.color.bac ? mapping.color.bac : this.colorList[colorIndex]
// eslint-disable-next-line vue/no-mutating-props
mapping && this.chartOption.color && (this.chartOption.color[colorIndex] = mapping.color.bac)
const legend = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex)
@@ -212,8 +212,8 @@ export default {
// .attr('stroke', 'white')
// 颜色
.attr('fill', (d, i) => {
if (d.data.color) {
return d.data.color
if (d.data.mapping.color.bac) {
return d.data.mapping.color.bac
} else {
return this.colorList[i]
}