Skip to content

Commit

Permalink
Merge pull request #9717 from dataease/pr@dev@feat_map
Browse files Browse the repository at this point in the history
feat: 地图空值区域颜色跟随主题
  • Loading branch information
fit2cloud-chenyw committed May 18, 2024
2 parents 8941757 + 028bd29 commit c59cae1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/frontend/src/views/chart/components/ChartComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,20 @@ export default {
const base_json = JSON.parse(JSON.stringify(BASE_MAP))
base_json.geo.map = mapId
let themeStyle = null
let panelColor = '#FFFFFF'
if (this.themeStyle) {
themeStyle = JSON.parse(JSON.stringify(this.themeStyle))
if (themeStyle && themeStyle.backgroundColorSelect) {
const panelColor = themeStyle.color
panelColor = themeStyle.color
if (panelColor !== '#FFFFFF') {
const reverseValue = reverseColor(panelColor)
this.buttonTextColor = reverseValue
} else {
this.buttonTextColor = null
}
} else if (this.canvasStyleData.openCommonStyle && this.canvasStyleData.panel.backgroundType === 'color') {
const panelColor = this.canvasStyleData.panel.color
panelColor = this.canvasStyleData.panel.color
if (panelColor !== '#FFFFFF') {
const reverseValue = reverseColor(panelColor)
this.buttonTextColor = reverseValue
Expand All @@ -474,6 +475,13 @@ export default {
}
}
const chart_option = baseMapOption(base_json, geoJson, chart, this.buttonTextColor, curAreaCode, this.currentSeriesId)
if (chart_option.geo.itemStyle.normal) {
chart_option.geo.itemStyle.normal.areaColor = `${panelColor}33`
} else {
chart_option.geo.itemStyle.normal = {
areaColor: `${panelColor}33`
}
}
if (chart_option.series?.length) {
const dataNames = []
chart_option.series.filter(se => se.type === 'map').forEach(se => {
Expand Down

0 comments on commit c59cae1

Please sign in to comment.