fix bug
This commit is contained in:
@ -75,6 +75,11 @@ export class DatatableBusiindexComponent implements OnInit {
|
|||||||
} else if(this.mode === 'month') {
|
} else if(this.mode === 'month') {
|
||||||
type = 2
|
type = 2
|
||||||
}
|
}
|
||||||
|
if(this.modeNext === 'year') {
|
||||||
|
type = 1
|
||||||
|
} else if(this.modeNext === 'month') {
|
||||||
|
type = 2
|
||||||
|
}
|
||||||
const params: any = {
|
const params: any = {
|
||||||
time: this.timeNext,
|
time: this.timeNext,
|
||||||
type
|
type
|
||||||
@ -83,8 +88,8 @@ export class DatatableBusiindexComponent implements OnInit {
|
|||||||
if (res) {
|
if (res) {
|
||||||
this.chartData = res
|
this.chartData = res
|
||||||
if(flag) {
|
if(flag) {
|
||||||
this.pillar.reRender()
|
// this.pillar.reRender()
|
||||||
this.curve.reRender()
|
// this.curve.reRender()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -112,9 +117,9 @@ export class DatatableBusiindexComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
changeDataNext() {
|
changeDataNext() {
|
||||||
if(this.mode === 'year') {
|
if(this.modeNext === 'year') {
|
||||||
this.dateFormat = 'yyyy'
|
this.dateFormat = 'yyyy'
|
||||||
} else if(this.mode === 'month') {
|
} else if(this.modeNext === 'month') {
|
||||||
this.dateFormat = 'yyyy-MM'
|
this.dateFormat = 'yyyy-MM'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,10 +127,15 @@ export class DatatableBusiindexComponent implements OnInit {
|
|||||||
if(result === null) {
|
if(result === null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.mode === 'year') {
|
console.log(this.mode);
|
||||||
|
if(this.modeNext === 'year') {
|
||||||
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00']
|
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00']
|
||||||
} else if(this.mode === 'month') {
|
} else if(this.modeNext === 'month') {
|
||||||
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00']
|
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00']
|
||||||
|
|
||||||
|
console.log(this.dateNext);
|
||||||
|
console.log(this.timeNext);
|
||||||
|
|
||||||
}
|
}
|
||||||
this.initData(true)
|
this.initData(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,9 +15,9 @@ export class BusitableCurveComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (this.chartData) {
|
if (this.chartData) {
|
||||||
// setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
// this.chart.render(true)
|
this.chart.render(true)
|
||||||
// }, 1000)
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -48,25 +48,23 @@ export class BusitableCurveComponent implements OnInit, OnChanges {
|
|||||||
year: {
|
year: {
|
||||||
range: [0, 1],
|
range: [0, 1],
|
||||||
},
|
},
|
||||||
value: {
|
number: {
|
||||||
min: 0,
|
min: -9999,
|
||||||
nice: true,
|
nice: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.chart.axis('value', {
|
const itemTpl = `
|
||||||
label: {
|
<div style="padding: 15px; color: red">
|
||||||
formatter: (val: any) => {
|
环比: {value}%
|
||||||
return val;
|
</div>
|
||||||
},
|
`
|
||||||
},
|
|
||||||
});
|
|
||||||
this.chart.tooltip({
|
this.chart.tooltip({
|
||||||
showCrosshairs: true, // 展示 Tooltip 辅助线
|
showCrosshairs: true, // 展示 Tooltip 辅助线
|
||||||
shared: true,
|
shared: true,
|
||||||
});
|
itemTpl: itemTpl
|
||||||
|
});
|
||||||
this.chart.line().position('time*value').label('value');
|
this.chart.line().position('time*number').label('number');
|
||||||
this.chart.point().position('time*value');
|
this.chart.point().position('time*number');
|
||||||
|
|
||||||
this.chart.render();
|
this.chart.render();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user