{"id":40552,"library":"ag-charts-server-side","title":"AG Charts Server-side","description":"AG Charts Server-side is a server-side charting library for Node.js (>=20.0.0) that renders charts to PNG or JPEG on the server using a headless canvas. Version 13.3.1 is stable with regular releases. It supports all AG Charts features (bar, line, pie, scatter, etc.) without browser dependencies, enabling chart generation for reports, emails, or APIs. Key differentiators: no Puppeteer/headless Chrome needed, faster rendering, and first-class TypeScript types.","status":"active","version":"13.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/ag-grid/ag-charts","tags":["javascript","charts","server-side","rendering","node","canvas","image","png","jpeg","typescript"],"install":[{"cmd":"npm install ag-charts-server-side","lang":"bash","label":"npm"},{"cmd":"yarn add ag-charts-server-side","lang":"bash","label":"yarn"},{"cmd":"pnpm add ag-charts-server-side","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core charting library; server-side rendering depends on its API","package":"ag-charts-community","optional":false}],"imports":[{"note":"AgCharts is imported from ag-charts-community; ag-charts-server-side provides the rendering environment.","wrong":"const AgCharts = require('ag-charts-server-side')","symbol":"AgCharts","correct":"import { AgCharts } from 'ag-charts-community'"},{"note":"As of v13, function is exported from ag-charts-server-side.","symbol":"createServerSideChart","correct":"import { createServerSideChart } from 'ag-charts-server-side'"},{"note":"AgChartInstance is a type exported from ag-charts-community, not from server-side package.","wrong":"import { AgChartInstance } from 'ag-charts-server-side'","symbol":"AgChartInstance","correct":"import type { AgChartInstance } from 'ag-charts-community'"}],"quickstart":{"code":"import { createServerSideChart } from 'ag-charts-server-side';\nimport { AgCharts } from 'ag-charts-community';\n\nasync function generateChart() {\n  const chart = await createServerSideChart({\n    container: null,\n    width: 800,\n    height: 600,\n    data: [\n      { month: 'Jan', revenue: 1200 },\n      { month: 'Feb', revenue: 1500 },\n      { month: 'Mar', revenue: 1100 },\n    ],\n    series: [{ type: 'bar', xKey: 'month', yKey: 'revenue' }],\n  });\n\n  const buffer = await chart.renderToBuffer({ format: 'png' });\n  console.log('Chart PNG buffer:', buffer);\n}\n\ngenerateChart().catch(console.error);","lang":"typescript","description":"Creates a server-side bar chart with sample data, renders it to PNG buffer."},"warnings":[{"fix":"Update imports to 'ag-charts-server-side'.","message":"Package name changed from ag-charts-enterprise to ag-charts-server-side in v10.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Upgrade Node.js or use older version.","message":"createServerSideChart() now requires Node.js >=20.0.0.","severity":"breaking","affected_versions":">=13.0.0"}],"env_vars":null,"search_vec":"'13.3.1':36 '20.0.0':20 'ag':1,6,45 'api':63 'bar':48 'browser':54 'canva':34,85 'chart':2,7,16,23,46,57,79 'chrome':68 'class':75 'depend':55 'differenti':65 'email':61 'enabl':56 'etc':52 'faster':70 'featur':47 'first':74 'first-class':73 'generat':58 'headless':33 'imag':86 'javascript':78 'jpeg':27,88 'key':64 'librari':17 'line':49 'need':69 'node':84 'node.js':19 'pie':50 'png':25,87 'puppeteer/headless':67 'regular':40 'releas':41 'render':22,71,83 'report':60 'scatter':51 'server':4,9,14,30,81 'server-sid':3,8,13,80 'side':5,10,15,82 'stabl':38 'support':43 'type':77 'typescript':76,89 'use':31 'version':35 'without':53","created_at":"2026-06-04T18:48:07.093329+00:00","updated_at":"2026-06-04T18:48:07.093329+00:00","problems":[{"fix":"Install 'canvas' package: npm install canvas","cause":"Missing native canvas dependency on Linux.","error":"Error: Could not find module 'canvas'"},{"fix":"Upgrade to ag-charts-server-side@13 and use chart.renderToBuffer() instead of .render().","cause":"Using older API without renderToBuffer.","error":"TypeError: chart.renderToBuffer is not a function"},{"fix":"Install ag-charts-community: npm install ag-charts-community","cause":"Missing peer dependency ag-charts-community.","error":"Module not found: Can't resolve 'ag-charts-community'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://www.ag-grid.com/charts/","github":"https://github.com/ag-grid/ag-charts","docs":null,"changelog":null,"pypi":null,"npm":"ag-charts-server-side","openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}