chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
63.9k stars 11.88k forks source link

Proper config is not provided #11779

Closed chetanukani closed 1 month ago

chetanukani commented 1 month ago

Documentation Is:

Please Explain in Detail...

Hello, If any new user comes into your documentation and tries to create their chart using this module then how do they identify how to create a chart from the server side in node js. I have reached out many times but have not provided sufficient resources to create a chart in node js. event there should a proper working example there. If I want to create line chart in node js how can I do this? There is no proper information of Canvas, you have just taken ctx but what ctx?

Your Proposal for Changes

I haven't please do for the same as I have mentioned above

Example

No response

LeeLenaleee commented 1 month ago

The canvas is not available on node by default since it is a UI element of the browser.

If you want to render charts on your server you need to make the canvas available on the server yourself by either writing your own canvas implementation or using someone else's like node-canvas. After you use that you can use chart.js the same way as in the browser by getting the context of the canvas and passing that to chart.js.

chetanukani commented 1 month ago

Okay, thanks @LeeLenaleee !!