mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
fix: 修复地图配色存在相同颜色时图例显示异常 #16203
This commit is contained in:
@@ -313,7 +313,9 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
|
||||
}
|
||||
})
|
||||
if (colorScale.length) {
|
||||
options.color['value'] = colorScale.map(item => (item.color ? item.color : item))
|
||||
options.color['value'] = colorScale.map(item =>
|
||||
item.color ? new ColorWrapper(item.color) : new ColorWrapper(item)
|
||||
)
|
||||
if (colorScale[0].value && !misc.mapAutoLegend) {
|
||||
options.color['scale']['domain'] = [
|
||||
minValue ?? filterEmptyMinValue(sourceData, 'value'),
|
||||
@@ -623,3 +625,15 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
|
||||
)(chart, options, context, this)
|
||||
}
|
||||
}
|
||||
|
||||
class ColorWrapper {
|
||||
private color: string
|
||||
|
||||
constructor(color: string) {
|
||||
this.color = color
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return this.color
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user