This commit is contained in:
wangshiming
2022-04-18 15:28:25 +08:00
parent 0493d19972
commit 771c2e51dc
2 changed files with 30 additions and 22 deletions

View File

@ -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">
环比:&nbsp;&nbsp;{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();
}