diff --git a/src/views/charts2/charts/npm/NpmLine.vue b/src/views/charts2/charts/npm/NpmLine.vue index 784cdbbc..4754849e 100644 --- a/src/views/charts2/charts/npm/NpmLine.vue +++ b/src/views/charts2/charts/npm/NpmLine.vue @@ -92,7 +92,7 @@ export default { deep: true, handler (n) { this.country = n - this.init() + this.init(n) } }, timeFilter: { @@ -102,14 +102,19 @@ export default { } }, methods: { - init () { + init (n) { const params = { startTime: getSecond(this.timeFilter.startTime), endTime: getSecond(this.timeFilter.endTime), - side: this.side, - country: this.country + side: this.side + // country: this.country // province: this.province } + if (n) { + params.country = n + } else { + params.country = '' + } this.toggleLoading(true) let url if (this.chart.params) { @@ -162,11 +167,16 @@ export default { this.myChart = echarts.init(dom) } this.chartOption = npmLineChartOption - const seriesTemplate = this.chartOption.series[0] this.chartOption.color = this.chartData.params.color this.chartOption.series = data.map((t, i) => { return { - ...seriesTemplate, + type: 'line', + symbol: 'circle', + smooth: true, + showSymbol: false, + emphasis: { + focus: 'series' + }, name: t.legend ? t.legend : this.$t(chartData.i18n) || chartData.name, stack: this.chartData.params.isStack ? 'network.total' : '', lineStyle: { diff --git a/src/views/charts2/charts/options/echartOption.js b/src/views/charts2/charts/options/echartOption.js index 8afc3cce..f4b3a55d 100644 --- a/src/views/charts2/charts/options/echartOption.js +++ b/src/views/charts2/charts/options/echartOption.js @@ -430,18 +430,7 @@ export const trafficLineChartOption = { } } ], - series: [ - { - type: 'line', - symbol: 'circle', - smooth: true, - showSymbol: false, - emphasis: { - focus: 'series' - }, - data: [] - } - ] + series: [] } export const linksTrafficSankeyOption = {