This commit is contained in:
Taric Xin
2022-04-22 15:35:07 +08:00
parent 155812d124
commit c2d5ef9261
4 changed files with 85 additions and 23 deletions

View File

@ -126,7 +126,7 @@ export class DatatableDataindexComponent implements OnInit {
const chart = new Chart({
container: el,
autoFit: true,
height: 400
height: 380
});
// 新建一个 view 用来单独渲染Annotation
const innerView = chart.createView();
@ -208,21 +208,21 @@ export class DatatableDataindexComponent implements OnInit {
position: ['50%', '50%'],
content: data[0].item,
style: {
fontSize: 20,
fontSize: 14,
fill: '#8c8c8c',
textAlign: 'center'
},
offsetY: -20
offsetY: -10
})
.text({
position: ['50%', '50%'],
content: data[0].count,
style: {
fontSize: 28,
fontSize: 16,
fill: '##000',
textAlign: 'center'
},
offsetY: 20
offsetY: 10
});
innerView.render(true);
@ -260,21 +260,21 @@ export class DatatableDataindexComponent implements OnInit {
position: ['50%', '50%'],
content: data.item,
style: {
fontSize: 20,
fontSize: 14,
fill: '#8c8c8c',
textAlign: 'center'
},
offsetY: -20
offsetY: -10
})
.text({
position: ['50%', '50%'],
content: data.count,
style: {
fontSize: 28,
fontSize: 16,
fill: '##000',
textAlign: 'center'
},
offsetY: 20
offsetY: 10
});
innerView.render(true);
lastItem = data.item;
@ -404,7 +404,7 @@ export class DatatableDataindexComponent implements OnInit {
const chart = new Chart({
container: el,
autoFit: true,
height: 400
height: 380
});
chart.data(data);
// 设置坐标轴