Commit d0669e4a authored by leon's avatar leon

feat: chart setOption let formatter done

parent 42386398
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
this.$set(this.ec.option, 'yAxis.data', categories) this.$set(this.ec.option, 'yAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}]) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
if(chart) {
// 重新setOption,使得设置的formatter生效
chart.setOption(this.ec.option)
}
if(preview) { if(preview) {
this.cacheImages(images) this.cacheImages(images)
} }
......
...@@ -91,6 +91,10 @@ ...@@ -91,6 +91,10 @@
this.$set(this.ec.option, 'xAxis.data', categories) this.$set(this.ec.option, 'xAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}]) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
if(chart) {
// 重新setOption,使得设置的formatter生效
chart.setOption(this.ec.option)
}
}, },
/** /**
* 处理数据 * 处理数据
......
...@@ -77,6 +77,10 @@ ...@@ -77,6 +77,10 @@
this.$set(this.ec.option, 'xAxis.data', categories) this.$set(this.ec.option, 'xAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}]) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
if(chart) {
// 重新setOption,使得设置的formatter生效
chart.setOption(this.ec.option)
}
}, },
/** /**
* 处理数据 * 处理数据
......
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
this.$set(this.ec.option, 'xAxis.data', categories) this.$set(this.ec.option, 'xAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}]) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
if(chart) {
// 重新setOption,使得设置的formatter生效
chart.setOption(this.ec.option)
}
}, },
/** /**
* 处理数据 * 处理数据
......
...@@ -59,6 +59,10 @@ export default { ...@@ -59,6 +59,10 @@ export default {
initChart() { initChart() {
const { series } = this.elementData.dataList const { series } = this.elementData.dataList
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
if(chart) {
// 重新setOption,使得设置的formatter生效
chart.setOption(this.ec.option)
}
}, },
dealSeriesData (data) { dealSeriesData (data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment