fix: 完善npm--location的Throughput曲线图的legend初始化
This commit is contained in:
@@ -85,7 +85,7 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
chartData: {},
|
chartData: {},
|
||||||
chartOptionLineData: dataForNpmLine.chartOptionLineData,
|
chartOptionLineData: [],
|
||||||
npmLineColor: dataForNpmLine.npmLineColor,
|
npmLineColor: dataForNpmLine.npmLineColor,
|
||||||
timer: null,
|
timer: null,
|
||||||
myChartArray: [],
|
myChartArray: [],
|
||||||
@@ -140,6 +140,7 @@ export default {
|
|||||||
this.showError = false
|
this.showError = false
|
||||||
this.isNoData = res.data.result.length === 0
|
this.isNoData = res.data.result.length === 0
|
||||||
|
|
||||||
|
this.chartOptionLineData = dataForNpmLine.chartOptionLineData
|
||||||
if (!this.isNoData) {
|
if (!this.isNoData) {
|
||||||
if (this.chart.params.index === 0) {
|
if (this.chart.params.index === 0) {
|
||||||
res.data.result.forEach((t, i) => {
|
res.data.result.forEach((t, i) => {
|
||||||
@@ -181,7 +182,7 @@ export default {
|
|||||||
// this.chartOption.color = this.chartOption.color.reverse()
|
// this.chartOption.color = this.chartOption.color.reverse()
|
||||||
// data = data.reverse()
|
// data = data.reverse()
|
||||||
|
|
||||||
this.chartOption.series = data.map((t, i) => {
|
this.chartOption.series = data.map(t => {
|
||||||
return {
|
return {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
@@ -274,7 +275,7 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (legend.length === 0) {
|
if (legend.length === 0) {
|
||||||
chartOptionLineData.forEach((t, i) => {
|
chartOptionLineData.forEach(t => {
|
||||||
t.invertTab = true
|
t.invertTab = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user