fix : 饼图D3 背景颜色更改
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user