-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to export chart using HTTP server #51
Comments
I have encountered the same problem with v1.0.15. |
I am also struggling with somehow same problem: My Postman request is : |
HTTP exports work as expected (tested on: https://github.com/highcharts/node-export-server/tree/enhancement/puppeteer). |
I'm new to this, but I cannot seem to get the HTTP server to return an actual chart. All i get are (image) files with the text "Chart input data error - TypeError: Request keys of a value that is not an object"
I've tried nodejs v4 and v6
I've tried highcharts-export-server v1.0.10, v1.0.14 and v1.0.15
Once starting the server, I've tried two charts:
curl -H "Content-Type: application/json" -X POST -d '{"infile":{"title": {"text": "Steep Chart"}, "xAxis": {"categories": ["Jan", "Feb", "Mar"]}, "series": [{"data": [29.9, 71.5, 106.4]}]}}' localhost:1337 -o mychart1.png
curl -H "Content-Type: application/json" -X POST -d '{"scale":1,"constr":"Chart","width":600,"infile":{"chart":{"type":"bar"},"title":{"text":"Fruit Consumption"},"xAxis":{"categories":["Apples","Bananas","Oranges"]},"yAxis":{"title":{"text":"Fruit eaten"}},"series":[{"name":"Jane","data":[1,0,4]},{"name":"John","data":[5,7,3]}]}}' localhost:1337 -o mychart2.png
Perhaps the problem is in the way I'm installing everything? Working on Ubuntu 14.04, installed the whole lot using:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo ln -s /usr/bin/nodejs /usr/sbin/node
sudo npm install highcharts-export-server@1.0.10 -g
Finally, starting the HTTP server itself using:
highcharts-export-server --enableServer 1 --host localhost --port 1337 --logLevel 4
Since the server runs --logLevel 4, this is the output produced by the server process for each of the two chart generation attempts above:
{ outfile: 'tmp/chart.3d33ee22cb254ecd941e8d058ef7b89d.png',
instr:
{ title: { text: 'Steep Chart' },
xAxis: { categories: [Object] },
series: [ [Object] ],
chart: { width: 600, height: 400 },
exporting: { enabled: false } },
constr: undefined,
type: 'png',
scale: undefined,
width: false,
svg: undefined,
resources: false,
callback: false,
styledMode: false,
asyncRendering: false,
globalOptions: false,
themeOptions: 'false',
customCode: false,
dataOptions: false,
async: false,
reqID: '3d33ee22cb254ecd941e8d058ef7b89d' }
{ outfile: 'tmp/chart.d65b4964f13a420290c2b22fa801a366.png',
instr:
{ chart: { type: 'bar', width: 600, height: 400 },
title: { text: 'Fruit Consumption' },
xAxis: { categories: [Object] },
yAxis: { title: [Object] },
series: [ [Object], [Object] ],
exporting: { enabled: false } },
constr: 'Chart',
type: 'png',
scale: 1,
width: 600,
svg: undefined,
resources: false,
callback: false,
styledMode: false,
asyncRendering: false,
globalOptions: false,
themeOptions: 'false',
customCode: false,
dataOptions: false,
async: false,
reqID: 'd65b4964f13a420290c2b22fa801a366' }
Fresh out of ideas, so anything welcome.
The text was updated successfully, but these errors were encountered: