如何使用Highcharts Export Server将图表输出至标准输出?
Highcharts Export Server: Stream Output to Standard Output
The issue you're hitting is that the --outfile flag isn't designed to handle special streams like /dev/stdout directly. Instead, the Highcharts Export Server CLI includes a dedicated --stdout flag specifically for streaming the generated chart image to standard output.
Here's the correct command to achieve what you want:
highcharts-export-server --infile ./chart_options.json --stdout
This will send the raw image data directly to stdout. If you want to capture this output into a file (as a replacement for your original --outfile usage), you can pipe it like this:
highcharts-export-server --infile ./chart_options.json --stdout > ./chart.png
The --stdout flag works cross-platform (including Windows, where /dev/stdout doesn't exist), making it a more reliable choice than trying to target stdout via --outfile.
内容的提问来源于stack exchange,提问作者Francesco Meli




