wcccode opened a new issue, #20520:
URL: https://github.com/apache/echarts/issues/20520
### Version
5.5.1
### Link to Minimal Reproduction
no
### Steps to Reproduce
var echarts = require('echarts');
const { createCanvas } = require('canvas');
const fs = require('fs');
echarts.setCanvasCreator(() => {
return createCanvas(800, 600);
});
const canvas = createCanvas(800, 600);
let chart = echarts.init(canvas);
const data = {
"employees": [
{ "name": "John Doe", "age": 30, "occupation": "Engineer" },
{ "name": "Jane Smith", "age": 28, "occupation": "Designer" }
]
};
var option = {
title: {
text: '10.01-10.15日活每日增长趋势'
},
tooltip: {},
legend: {
data: ['活跃数'],
bottom: '10'
},
xAxis: {
data: ['2024-10-1', '2024-10-2', '2024-10-3', '2024-10-4', '2024-10-5',
'2024-10-6', '2024-10-7', '2024-10-8', '2024-10-9', '2024-10-10', '2024-10-11',
'2024-10-12', '2024-10-13', '2024-10-14', '2024-10-15']
},
yAxis: {},
series: [{
name: '活跃数',
type: 'line',
data: [86, 38, 45, 37, 37, 37, 60, 589, 545, 653, 891, 838, 225, 708,
597],
label: {
show: true, // 显示每个数据点的标签
position: 'top', // 标签的位置,可以是 'top', 'left', 'right', 'bottom'
formatter: '{c}' // 显示数据的值
}
}]
};
chart.setOption(option);
const buffer = canvas.toBuffer('image/png');
chart.dispose();
chart = null;
fs.writeFileSync('chart.png', buffer);
### Current Behavior
折线图未显示数值
### Expected Behavior
折线图显示数值
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
测试结果:

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]