annotations not working with node export server
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
- 领域
- backend
调研方向
首先运行提供的模块脚本并检查 lib/index.js,尤其是 mapToNewConfig、setOptions、initExport 和 startExport。将生成的图像与提供的图表选项进行比较,并跟踪导出过程中注释的处理方式。导出的图像包含两个注释即表示完成。
由索引模型根据 Issue 内容生成。
描述
"I am using the Highcharts Node Export Server, and my chart contains annotations. However, when I export the chart using the Node module or the Highcharts server arguments , the exported image does not include any annotations.
I need a solution to fix this issue, please."
Expected behaviour
Chart image with annotations
Actual behaviour
Chart image without annotations
![options_phantom]
(https://github.com/user-attachments/assets/b8f833bf-f115-4ad2-90e1-cfdf6f6ac315)
Reproduction steps
### here is js code used
import { writeFileSync } from 'fs';
import exporter from '../../lib/index.js';
// Export settings with the old options structure (PhantomJS)
// Will be mapped appropriately to the new structure with the mapToNewConfig utility
const exportSettings = {
type: 'png',
constr: 'chart',
outfile: './samples/module/options_phantom.jpeg',
logLevel: 4,
scale: 1,
workers: 1,
options: {
chart: {
type: "column",
backgroundColor: "#FFFFFF",
},
title: {
text: "Monthly Revenue",
},
xAxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
title: {
text: "Months",
},
},
yAxis: {
min: 0,
title: {
text: "Revenue (USD)",
},
},
series: [
{
name: "Revenue",
data: [3000, 4000, 3200, 5000, 4500, 6000, 7000, 6800, 6200, 7500, 8200, 9000],
},
],
annotations: [
{
labels: [
{
point: {
xAxis: 0,
yAxis: 0,
x: 3, // April
y: 5000,
},
text: "Highest Revenue of the Quarter",
},
{
point: {
xAxis: 0,
yAxis: 0,
x: 11, // December
y: 9000,
},
text: "Year-End Peak",
},
],
},
],
}
};
const start = async () => {
try {
// Map to fit the new options structure
const mappedOptions = exporter.mapToNewConfig(exportSettings);
// Set the new options
const options = exporter.setOptions(mappedOptions);
// Init a pool for one export
await exporter.initExport(options);
// Perform an export
await exporter.startExport(options, async (error, info) => {
// Exit process and display error
if (error) {
throw error;
}
const { outfile, type } = info.options.export;
// Save the base64 from a buffer to a correct image file
writeFileSync(
outfile,
type !== 'svg' ? Buffer.from(info.result, 'base64') : info.result
);
// Kill the pool
await exporter.killPool();
});
} catch (error) {
// Log the error with stack
exporter.logWithStack(1, error);
// Gracefully shut down the process
await exporter.shutdownCleanUp(1);
}
};
start();
- 主要语言
- JavaScript
- 星标
- 368
- 派生
- 266
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
highcharts/node-export-server 的其他 Issue
-
Update Puppeteer to version 25.11.0+ to allow ARM64 linux images to run node-export-server可能已有人在做 @daniatic 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
highcharts/node-export-server#686 ·
-
难度 3/5 半天 新手友好度 66/100
highcharts/node-export-server#690 ·
-
难度 3/5 1-2 天 新手友好度 35/100
highcharts/node-export-server#680 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
highcharts/node-export-server#679 ·
-
难度 3/5 1-2 天 新手友好度 45/100
highcharts/node-export-server#678 ·
查看 highcharts/node-export-server 的全部 Issue
相似的 Issue
-
bug lsp sev-3
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 90/100
Miaotofu01/Study-Mate#206 ·
维护者通常 1 天内回复
-
effort:low model:light plan planner:fable-5-1 test-quality tests
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 63/100
zhw2590582/ArtPlayer#1073 ·