Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chart): Fix chart dataZoom bug and colors bug #2513

Merged
merged 11 commits into from
Nov 26, 2024
4 changes: 2 additions & 2 deletions internals/cli/src/commands/build/build-entry-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const buildFullRuntime = (mode: RunTimeModeType) => {
.map((component) => {
if (component.includes('Hui')) {
return `${component}${joinStr}${component} as ${component
.replace('Huicharts', 'Charts')
.replace('Huicharts', 'Chart')
.trim()}${joinStr}${component} as Tiny${component.trim()}`
}
return `${component}${joinStr}${component} as Tiny${component.trim()}`
Expand All @@ -161,7 +161,7 @@ const buildFullRuntime = (mode: RunTimeModeType) => {
.map((component) => {
if (component.includes('Hui')) {
return `${component}${joinStr}${component
.replace('Huicharts', 'Charts')
.replace('Huicharts', 'Chart')
.trim()}: ${component}${joinStr}Tiny${component.trim()}: ${component}`
}
return `${component}${joinStr}Tiny${component.trim()}: ${component}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default {
mixins: [Core],
data() {
return {
iChartName: 'AutonaviMapChart',
option: {}
iChartName: 'AutonaviMapChart'
}
},
mounted() {
Expand Down
3 changes: 1 addition & 2 deletions packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default {
mixins: [Core],
data() {
return {
iChartName: 'BarChart',
option: {}
iChartName: 'BarChart'
}
},
methods: {
Expand Down
7 changes: 1 addition & 6 deletions packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default {
mixins: [Core],
data() {
return {
iChartName: 'BaiduMapChart',
option: {}
iChartName: 'BaiduMapChart'
}
},
methods: {
Expand All @@ -27,10 +26,6 @@ export default {
this.huiChartOption.tooltip = { show: false }
}

if (!this.legendVisible) {
this.huiChartOption.legend = { show: false }
}

return
}

Expand Down
12 changes: 6 additions & 6 deletions packages/vue/src/huicharts/huicharts-core/src/chart-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
},
width: { type: String, default: 'auto' },
height: { type: String, default: '400px' },
events: { type: Object, default() {} },
events: { type: Object, default() { } },
initOptions: {
type: Object,
default() {
Expand Down Expand Up @@ -72,7 +72,7 @@ export default {
},
extend: {
type: Object,
default() {}
default() { }
},
tooltipFormatter: { type: Function },

Expand Down Expand Up @@ -120,7 +120,7 @@ export default {
},
setOptionOpts: {
type: Object,
default() {}
default() { }
},
colorMode: {
type: String,
Expand Down Expand Up @@ -351,9 +351,9 @@ export default {
} else {
this.huiChartOption = cloneDeep(this.options)
}
let { huiChartOption } = this
let huiChartOption = cloneDeep(this.huiChartOption)
if (!huiChartOption.theme) {
huiChartOption.theme = 'bpit-light'
huiChartOption.theme = 'cloud-light'
}
if (Array.isArray(this.colors) && this.colors.length > 0) {
huiChartOption.color = cloneDeep(this.colors)
Expand Down Expand Up @@ -389,7 +389,7 @@ export default {
renderChart(huiChartOption) {
// 设置默认theme为'cloud-light'
if (!huiChartOption.theme) {
huiChartOption.theme = 'bpit-light'
huiChartOption.theme = 'cloud-light'
}

// 将外部colors放入配置项中
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import { $prefix } from '@opentiny/vue-common'
export default {
name: $prefix + 'ChartHeatmap',
mixins: [Core],
data() {
return {
option: {}
}
},
computed: {
iChartName() {
const { type } = this.settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default {
mixins: [Core],
data() {
return {
iChartName: 'BarChart',
option: {}
iChartName: 'BarChart'
}
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default {
const option = line(columns, rows, this.settings, extra)

this.huiChartOption = {
smooth: true,
...option
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default {
mixins: [Core],
data() {
return {
iChartName: 'SunburstChart',
option: {}
iChartName: 'SunburstChart'
}
},
methods: {
Expand Down
3 changes: 1 addition & 2 deletions packages/vue/src/huicharts/huicharts-tree/src/chart-tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default {
mixins: [Core],
data() {
return {
iChartName: 'TreeChart',
option: {}
iChartName: 'TreeChart'
}
},
methods: {
Expand Down
Loading