Merge pull request #7494 from dataease/pr@dev@fix_chart_render
Pr@dev@fix chart render
This commit is contained in:
commit
ec2b03e54a
@ -49,7 +49,7 @@ export function baseBarOption(chart_option, chart, activeParam) {
|
||||
y.type = 'bar'
|
||||
y.selectedMode = true
|
||||
y.select = BASE_ECHARTS_SELECT
|
||||
chart_option.legend.data.push(y.name)
|
||||
chart_option.legend.data.push(y.name ?? 'null')
|
||||
chart_option.series.push(y)
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,7 @@ export function horizontalBarOption(chart_option, chart) {
|
||||
y.type = 'bar'
|
||||
y.selectedMode = true
|
||||
y.select = BASE_ECHARTS_SELECT
|
||||
chart_option.legend.data.push(y.name)
|
||||
chart_option.legend.data.push(y.name ?? 'null')
|
||||
chart_option.series.push(y)
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ export function baseLineOption(chart_option, chart) {
|
||||
y.label = customAttr.label
|
||||
}
|
||||
y.type = 'line'
|
||||
chart_option.legend.data.push(y.name)
|
||||
chart_option.legend.data.push(y.name ?? 'null')
|
||||
chart_option.series.push(y)
|
||||
}
|
||||
}
|
||||
|
||||
@ -3533,9 +3533,11 @@ export function getColors(chart, colors, reset) {
|
||||
if (chart.data) {
|
||||
const data = chart.data.data
|
||||
const stackData = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const s = data[i]
|
||||
stackData.push(s.category)
|
||||
if (data?.length) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const s = data[i]
|
||||
stackData.push(s.category)
|
||||
}
|
||||
}
|
||||
const sArr = stackData.filter(function(item, index, stackData) {
|
||||
return stackData.indexOf(item, 0) === index
|
||||
|
||||
@ -145,7 +145,8 @@ export default {
|
||||
'line-stack',
|
||||
'scatter'
|
||||
],
|
||||
resizeTimer: null
|
||||
resizeTimer: null,
|
||||
renderTimer: null
|
||||
}
|
||||
},
|
||||
|
||||
@ -499,7 +500,11 @@ export default {
|
||||
// 指定图表的配置项和数据
|
||||
const chart = this.myChart
|
||||
this.setBackGroundBorder()
|
||||
setTimeout(chart.setOption(option, true), 500)
|
||||
this.renderTimer && clearTimeout(this.renderTimer)
|
||||
this.renderTimer = setTimeout(() => {
|
||||
chart.clear()
|
||||
chart.setOption(option, true)
|
||||
}, 500)
|
||||
window.removeEventListener('resize', chart.resize)
|
||||
},
|
||||
setBackGroundBorder() {
|
||||
|
||||
@ -2114,7 +2114,8 @@ export default {
|
||||
equalsAny(this.view.type, 'table-normal', 'table-info', 'map', 'text') || this.view.render === 'echarts' && includesAny(this.view.type, 'mix')
|
||||
},
|
||||
showFunctionCfg() {
|
||||
return includesAny(this.view.type, 'bar', 'line', 'area', 'mix', 'table') ||
|
||||
return includesAny(this.view.type, 'bar', 'line', 'area', 'mix') ||
|
||||
(this.view.render === 'antv' && this.view.type.includes('table')) ||
|
||||
equalsAny(this.view.type, 'map', 'text')
|
||||
},
|
||||
showScrollCfg() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user