To render an SVG chart as a PNG, open the page containing the chart in headless Chrome and capture either the viewport or the chart’s bounds. For a one-off capture, use Chrome’s --screenshot flag; for repeatable or precisely framed captures, use Puppeteer’s Page.screenshot(). Choose the capture size and wait for the chart’s own render-ready condition before taking the screenshot.
Choose the capture method
Both Chrome’s command-line interface and Puppeteer can capture a browser-rendered SVG chart as a PNG. Use the CLI for a quick page screenshot; use Puppeteer when you need to automate capture, wait on page state, or frame a specific element.
| Method | Best fit | Framing options |
|---|---|---|
| Chrome CLI | A one-off screenshot of a page | Set the viewport with --window-size; the screenshot captures the page at that size. |
| Puppeteer | Scripted captures or chart-specific framing | Capture the viewport, the full page, a clip rectangle, or an element. |
Chrome’s official command-line reference says --screenshot saves the target page as screenshot.png in the current working directory: Chrome headless command-line reference.
Capture a chart with Chrome’s command line
First make the chart page available at a URL. This can be a local page served by your application or a reachable site. The command captures the page as Chrome renders it; it does not create an SVG chart or configure a chart library.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- SLIM. LIGHTWEIGHT. READY TO GO: The all-new slim design is perfect for busy lives on the go.
- SKILLFULLY DESIGNED. MILITARY TOUGH: Built with premium craftsmanship to withstand the occasional drop or ding.
- ALL-DAY, ALL-IN-ONE CHARGING: Power through your school day – and beyond – with a long-lasting 12-hour battery.¹
- 3X FASTER THAN THE PREVIOUS GENERATION OF WIFI: Crush your schoolwork in record time with Wi-Fi that’s three times faster than the previous generation of Wi-Fi.
- YOUR PHONE AND CHROMEBOOK WORK BETTER TOGETHER: Easily transfer files between devices, and control your phone right from your Chromebook.
- Open a terminal in the directory where you want the PNG saved.
- Run Chrome in headless mode with a viewport large enough for the chart:
chrome --headless --window-size=1200,800 --screenshot=https://example.com/chart
Replace chrome with the Chrome executable name or path used on your system, and replace the example URL with the page that contains your chart. Chrome writes screenshot.png to the current working directory. The Chrome documentation also shows the newer headless mode with --headless=new; confirm the accepted flags for the Chrome version installed on your machine.
--window-size=1200,800 sets the capture viewport, not a promise that the chart itself fills the output. Adjust its width and height to the chart’s layout. If the chart extends beyond the viewport, the CLI screenshot may not include all of it; use Puppeteer’s full-page capture or a clipped element screenshot when you need different framing.
Optional timeout
You can set a maximum wait before Chrome takes the screenshot:
chrome --headless --window-size=1200,800 --timeout=5000 --screenshot=https://example.com/chart
--timeout is a maximum wait after which capture happens even if the page is still loading. It does not verify that an SVG chart or its data has finished rendering, so a longer timeout alone is not a reliable readiness check.
Recommended Free Tools
Capture the chart with Puppeteer
Puppeteer exposes screenshot settings through Page.screenshot(). Install Puppeteer in your Node.js project, then use a readiness condition that matches your page. The example below waits for an application-defined selector, #chart-ready; your chart page must set or expose that condition after rendering is complete.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage({
viewport: { width: 1200, height: 800 }
});
await page.goto('https://example.com/chart', {
waitUntil: 'domcontentloaded'
});
await page.waitForSelector('#chart-ready');
await page.screenshot({ path: 'chart.png' });
} finally {
await browser.close();
}
Change the URL and readiness selector to match your application. If the page does not expose a meaningful ready signal, determine one from the chart library or application state rather than assuming that a fixed delay proves the chart is complete. These browser screenshot APIs do not define a universal ready condition for every SVG chart.
Rank #2
- Storage: 16GB Flash Memory
- OS: Chrome OS
- Screen Size: 11.6"
Choose viewport, full-page, or chart-only framing
The screenshot dimensions and framing depend on the capture mode. Puppeteer’s screenshot API supports fullPage, clip, and omitBackground; PNG is its default screenshot type. See the Puppeteer screenshot options and Page.screenshot() API.
Viewport screenshot
The default call captures the visible page viewport. Set the viewport before navigation or capture so the page lays out at the dimensions you expect:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11await page.setViewport({ width: 1200, height: 800 });
await page.screenshot({ path: 'chart.png' });
Full-page screenshot
Use fullPage: true if you need the entire document rather than only the visible viewport:
await page.screenshot({ path: 'chart-full.png', fullPage: true });
This captures the full page, not just the chart. If the chart sits on a long page, an element screenshot may produce a more useful chart-only image.
Chart element screenshot
Puppeteer can screenshot an element directly. Select an SVG, its chart container, or another element that encloses the complete visualization:
const chart = await page.waitForSelector('#chart');
if (!chart) throw new Error('Chart element was not found');
await chart.screenshot({ path: 'chart.png' });
Use a selector that matches the element rendered by your page. If the SVG is cropped by its container or has overflow outside it, capture the correct enclosing element or adjust the page layout before capture.
Rank #3
- FOR HOME, WORK, & SCHOOL – With an Intel processor, 14-inch display, custom-tuned stereo speakers, and long battery life, this Chromebook laptop lets you knock out any assignment or binge-watch your favorite shows..Voltage:5.0 volts
- HD DISPLAY, PORTABLE DESIGN – See every bit of detail on this micro-edge, anti-glare, 14-inch HD (1366 x 768) display (1); easily take this thin and lightweight laptop PC from room to room, on trips, or in a backpack.
- ALL-DAY PERFORMANCE – Reliably tackle all your assignments at once with the quad-core, Intel Celeron N4120—the perfect processor for performance, power consumption, and value (2).
- 4K READY – Smoothly stream 4K content and play your favorite next-gen games with Intel UHD Graphics 600 (3) (4).
- MEMORY AND STORAGE – Enjoy a boost to your system’s performance with 4 GB of RAM while saving more of your favorite memories with 64 GB of reliable flash-based eMMC storage (5).
Clip to a rectangle
For a precise region, pass a clip rectangle in page coordinates:
await page.screenshot({
path: 'chart-clip.png',
clip: { x: 100, y: 80, width: 900, height: 500 }
});
Set the rectangle to cover the chart’s rendered bounds. A clip that misses part of the chart will crop it; one that is too large will include surrounding page content.
Transparent background
When the output should have a transparent page background, use omitBackground: true:
await page.screenshot({
path: 'chart-transparent.png',
omitBackground: true
});
The chart or its page may still draw its own background. Check the output in the application that will consume it to confirm the transparency and dimensions meet your needs.
Wait for dynamic charts to finish rendering
A page-load event and a chart-render event are not necessarily the same thing. A chart may be drawn after data arrives, after fonts or other assets load, or after client-side code runs. Wait for the condition that means your own chart is ready—such as a chart container becoming visible, a completion flag set by the application, or a known element appearing with its final content.
- Use a page-specific selector or state that is set only after the chart is ready.
- If chart data loads asynchronously, make readiness depend on that data and the completed render, not merely on the initial HTML response.
- Do not treat Chrome’s
--timeoutas confirmation of readiness; it only sets a maximum wait before capture. - Inspect the resulting PNG for missing marks, labels, fonts, or clipped edges.
Output format and verification
Chrome’s DevTools Protocol lists PNG as the default headless screenshot format and also supports JPEG and WebP. For this task, PNG is a sensible default when you need a raster image of chart lines, labels, and shapes. The protocol’s supported formats are documented in the captureScreenshot parameters.
Rank #4
- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
After capture, check the PNG’s pixel dimensions and background in the workflow that will use it. The screenshot reflects the browser-rendered page at capture time; the cited documentation does not establish pixel-perfect equivalence across Chrome versions or provide a universal SVG-chart conversion recipe.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting
No screenshot file appears
Chrome writes screenshot.png in the current working directory unless a different output path is supported by the installed command’s options. Check the terminal’s working directory, confirm the Chrome executable runs, and consult the command-line reference for the flags accepted by your Chrome version.
The PNG is blank or the chart is missing
Confirm the page URL loads in a regular browser and that the chart is rendered in the page before capture. In Puppeteer, wait for an application-specific chart-ready condition; a navigation event or fixed delay may occur before the chart is drawn.
The chart is cut off
Increase the viewport dimensions for a viewport capture, use fullPage: true for a long document, or capture the chart element directly. For a clip screenshot, revise the x, y, width, and height values to cover the intended bounds.
The background is opaque
Use Puppeteer’s omitBackground: true if the page background should be transparent, then check that the chart itself does not paint an opaque background.
The capture is inconsistent between runs
Make readiness depend on the page’s actual chart-render completion rather than a guessed delay. Ensure the page is rendered at a deliberate viewport and verify that the chart’s data and required assets are available before taking the screenshot.
Free tools Windows power users keep installed
One-click scans. No signup required.
Or skip the browser setup
ScreenshotNeo can return a PNG from one GET request, with options for full-page and element capture. Cookie banners are accepted and removed, along with known newsletter popups and chat widgets, before capture; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
See the ScreenshotNeo documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/chart -o chart.webp
Sign up for 1,000 free screenshots a month with no card.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

