#Alternative of chartjs-node-canvas for DiscordJS

1 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" }
);