fix bug
This commit is contained in:
@ -15,9 +15,9 @@ export class BusitableCurveComponent implements OnInit, OnChanges {
|
||||
}
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (this.chartData) {
|
||||
// setTimeout(()=>{
|
||||
// this.chart.render(true)
|
||||
// }, 1000)
|
||||
setTimeout(()=>{
|
||||
this.chart.render(true)
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
}
|
||||
@ -48,25 +48,23 @@ export class BusitableCurveComponent implements OnInit, OnChanges {
|
||||
year: {
|
||||
range: [0, 1],
|
||||
},
|
||||
value: {
|
||||
min: 0,
|
||||
number: {
|
||||
min: -9999,
|
||||
nice: true,
|
||||
},
|
||||
});
|
||||
this.chart.axis('value', {
|
||||
label: {
|
||||
formatter: (val: any) => {
|
||||
return val;
|
||||
},
|
||||
},
|
||||
});
|
||||
const itemTpl = `
|
||||
<div style="padding: 15px; color: red">
|
||||
环比: {value}%
|
||||
</div>
|
||||
`
|
||||
this.chart.tooltip({
|
||||
showCrosshairs: true, // 展示 Tooltip 辅助线
|
||||
shared: true,
|
||||
});
|
||||
|
||||
this.chart.line().position('time*value').label('value');
|
||||
this.chart.point().position('time*value');
|
||||
itemTpl: itemTpl
|
||||
});
|
||||
this.chart.line().position('time*number').label('number');
|
||||
this.chart.point().position('time*number');
|
||||
|
||||
this.chart.render();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user