You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "wcccode (via GitHub)" <gi...@apache.org> on 2024/11/15 07:32:01 UTC
[I] [Bug] 服务端渲染图片,折线图数值未展示 [echarts]
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: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 服务端渲染图片,折线图数值未展示 [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #20520:
URL: https://github.com/apache/echarts/issues/20520#issuecomment-2478135753
@wcccode It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
<details><summary><b>TRANSLATED</b></summary><br>
**TITLE**
[Bug] The server renders the image, but the line chart value is not displayed
</details>
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 服务端渲染图片,折线图数值未展示 [echarts]
Posted by "sz-p (via GitHub)" <gi...@apache.org>.
sz-p commented on issue #20520:
URL: https://github.com/apache/echarts/issues/20520#issuecomment-2480761090
Try `animation: false`.
All options are below
```js
{
title: {
text: "10.01-10.15日活每日增长趋势",
},
animation: false,
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}", // 显示数据的值
},
},
],
}
```
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 服务端渲染图片,折线图数值未展示 [echarts]
Posted by "wcccode (via GitHub)" <gi...@apache.org>.
wcccode commented on issue #20520:
URL: https://github.com/apache/echarts/issues/20520#issuecomment-2480895958
Thanks, it works.
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 服务端渲染图片,折线图数值未展示 [echarts]
Posted by "wcccode (via GitHub)" <gi...@apache.org>.
wcccode commented on issue #20520:
URL: https://github.com/apache/echarts/issues/20520#issuecomment-2478136469
您好,您的来信我已收到,谢谢!!!
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] 服务端渲染图片,折线图数值未展示 [echarts]
Posted by "wcccode (via GitHub)" <gi...@apache.org>.
wcccode closed issue #20520: [Bug] 服务端渲染图片,折线图数值未展示
URL: https://github.com/apache/echarts/issues/20520
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org