fix:修复图表维度为数字类型时图表展示不全的问题

main
liu.shiyi 2 years ago
parent a0d533cb45
commit 613e09fae5

@ -121,7 +121,7 @@ export default {
renderer: 'svg', renderer: 'svg',
// //
supportCSSTransform: true, supportCSSTransform: true,
...config.option, ...config.option
}) })
this.chart.render() this.chart.render()
this.registerEvent() this.registerEvent()
@ -180,7 +180,14 @@ export default {
console.error(e) console.error(e)
} }
} }
config.option.data = data // g2plot
const xAxis = config.setting.find(item => item.field === 'xField')?.value
config.option.data = data.map(item => {
if (xAxis && typeof item[xAxis] === 'number') {
item[xAxis] = (item[xAxis]).toString()
}
return item
})
} else { } else {
// //
config.option.data = this.plotList?.find(plot => plot.name === config.name)?.option?.data || config?.option?.data config.option.data = this.plotList?.find(plot => plot.name === config.name)?.option?.data || config?.option?.data

Loading…
Cancel
Save