#Alternative of chartjs-node-canvas for DiscordJS

3 messages · Page 1 of 1 (latest)

small void
#

To be able to send a ChartJS graph on DiscordJS, I have to use this package chartjs-node-canvas, but it is not maintained anymore.

Is there a maintained alternative to this package or is there a solution to use only ChartJS without additional package?

const config: ChartConfiguration = { ... };
const chart = new ChartJSNodeCanvas({ height: 500, width: 1100 });

chart.registerFont(`${__dirname}/../../../resources/font/poppins-regular.ttf`, { family: "Poppins" });

const attachment = new AttachmentBuilder(
  chart.renderToBufferSync(config),
  { name: "chart.png" }
);
elfin flicker
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

buoyant merlin