Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
browser automation

How to Capture a vis.js Timeline in a Website Screenshot

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture a vis.js Timeline the same way you capture other browser content: render the page, set the timeline to the state you want, wait for the site’s data and layout to be ready, then screenshot either the timeline element, the current viewport, or the full page. Because Timeline renders with regular HTML DOM, browser screenshot tools such as Playwright and Puppeteer can capture it. The key to a reliable result is controlling the timeline’s visible time window and its container dimensions before taking the shot.

Choose what the screenshot should include

Before writing capture code, decide where the image should begin and end. “Screenshot the timeline” can mean the chart alone, the visible browser area with its surrounding controls, or the entire page. These are different capture boundaries, and the right choice depends on how the screenshot will be used.

Capture scope Use it when Watch for
Timeline element You need a standalone chart for a report, test artifact, or image preview. The screenshot boundary follows the element’s rendered box. It may not include page headers, legends, or controls outside that element. A timeline with its own internal scrolling region can still show only the portion visible inside that region.
Viewport The surrounding page context matters and the relevant timeline area is already visible on screen. Content outside the browser viewport is excluded. Set a consistent viewport size so the timeline wraps and lays out as expected.
Full page You need content above or below the visible browser area as well as the timeline. A full-page capture concerns the page’s scrollable document; it does not automatically expand a timeline’s own internally scrollable area to reveal every item.

Playwright documents viewport, element, and full-page screenshots; Puppeteer documents page and element screenshots. Use whichever tool your project already runs if it meets your needs. For a chart-only image, an element capture is usually the most direct starting point. If the chart is clipped by its own fixed-height container, first change the page or timeline configuration rather than assuming full-page mode will expose hidden timeline content.

Prepare the timeline for a repeatable capture

A screenshot records the state that the browser has rendered; it does not decide which dates, items, or layout should appear. Set those deliberately before capture. The vis-timeline documentation describes dimension options and the setWindow method for controlling the visible time range.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Fix the visible time window

If the website chooses its initial date range from the current date, user input, or asynchronously loaded data, repeated runs may produce different images. When you control the page, set the intended window after the Timeline is initialized and its data is available. For example, the application might call timeline.setWindow(start, end) with the same start and end dates for each capture. The actual values should match the site’s data and the story the screenshot needs to show; there is no universal date range that suits every timeline.

When the target is a third-party website and you cannot change its code, use its visible controls if available. Otherwise, capture only after the site has reached the state you need, and verify the resulting image rather than assuming the default view is stable.

Choose stable dimensions

Timeline dimensions affect how much content fits, whether labels wrap, and how much horizontal scrolling is needed. Set the container dimensions through the page’s own configuration or CSS when you control the site. Also set the browser viewport explicitly in automation. A viewport that is too narrow can change the layout; one that is too short may crop surrounding content in a viewport screenshot.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Wait for the page-specific ready condition

There is no single readiness signal that works for every vis-timeline website. A page may load data, fonts, images, or custom item templates after the document itself has loaded. Use a condition that reflects the target application: for example, a site-owned element that appears once data is rendered, or an application flag exposed for tests. Then check that the expected items and time window are actually visible. Waiting an arbitrary fixed number of milliseconds can work for a known, stable environment, but it is less reliable when network or rendering time varies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture with Playwright

Playwright’s locator screenshot is a straightforward way to capture just the timeline. The following Node.js script expects a URL and selector, waits for the selected element, and saves a PNG. It deliberately leaves the application-specific readiness condition as an optional selector, because the target site determines when its data and custom rendering are ready.

  1. Install Playwright: run npm install playwright in a project directory. Install the browser binary if needed with npx playwright install chromium.
  2. Save the script: create capture-timeline.cjs with the code below.
  3. Run it: provide the page URL and the CSS selector for the timeline container. If the site has a reliable ready marker, provide its selector too.
const { chromium } = require('playwright');

(async () => {
  const url = process.argv[2];
  const selector = process.argv[3] || '#visualization';
  const readySelector = process.argv[4];

  if (!url) {
    throw new Error('Usage: node capture-timeline.cjs <url> [timeline-selector] [ready-selector]');
  }

  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage({
    viewport: { width: 1440, height: 1000 },
    deviceScaleFactor: 1
  });

  try {
    await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
    await page.locator(selector).waitFor({ state: 'visible', timeout: 30000 });

    if (readySelector) {
      await page.locator(readySelector).waitFor({ state: 'visible', timeout: 30000 });
    }

    await page.locator(selector).screenshot({ path: 'timeline.png' });
    console.log('Saved timeline.png');
  } finally {
    await browser.close();
  }
})();

Example invocation: node capture-timeline.cjs https://example.com/timeline '#visualization' '[data-test="timeline-ready"]'. Replace the example URL and selectors with elements that actually exist on the target page. The selector #visualization is common in examples, not a guaranteed ID on every website. If you omit the ready selector, the script waits for the timeline element to be visible but does not know whether the site’s data has finished rendering.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Use viewport or full-page capture instead

Once the page is loaded and in the intended state, replace the element screenshot line with a page screenshot according to the desired boundary:

// Current viewport only:
await page.screenshot({ path: 'timeline-viewport.png' });

// Entire scrollable document:
await page.screenshot({ path: 'timeline-full-page.png', fullPage: true });

For full-page output, inspect the result for unexpectedly large empty areas or page content that changes as it scrolls. If the timeline itself has an internal scrollbar, that is a separate region from the page scroll. Adjust the timeline container or its visible window if the image must show more items.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture with Puppeteer

Puppeteer supports the same basic element-oriented workflow. This standalone Node.js example launches Chromium, opens the target page, waits for the chart container to be visible, and saves that element. Install Puppeteer with npm install puppeteer, then save the script as capture-timeline-puppeteer.cjs.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
const puppeteer = require('puppeteer');

(async () => {
  const url = process.argv[2];
  const selector = process.argv[3] || '#visualization';
  const readySelector = process.argv[4];

  if (!url) {
    throw new Error('Usage: node capture-timeline-puppeteer.cjs <url> [timeline-selector] [ready-selector]');
  }

  const browser = await puppeteer.launch({ headless: true });

  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1440, height: 1000, deviceScaleFactor: 1 });
    await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
    await page.waitForSelector(selector, { visible: true, timeout: 30000 });

    if (readySelector) {
      await page.waitForSelector(readySelector, { visible: true, timeout: 30000 });
    }

    const timeline = await page.$(selector);
    if (!timeline) {
      throw new Error(`Timeline element not found: ${selector}`);
    }

    await timeline.screenshot({ path: 'timeline.png' });
    console.log('Saved timeline.png');
  } finally {
    await browser.close();
  }
})();

To capture the current viewport with Puppeteer, use await page.screenshot({ path: 'timeline-viewport.png' }). To request a full-page screenshot, use await page.screenshot({ path: 'timeline-full-page.png', fullPage: true }). As with Playwright, full-page capture concerns the document’s page length, not necessarily the full contents of a nested scrolling chart.

Make captures useful for testing and sharing

For a one-off image, a successful file write may be enough. For a repeatable test, define the capture inputs so that an unexpected screenshot points to a meaningful change rather than a random difference.

  • Pin the browser automation version: use the Playwright or Puppeteer version managed by the project, and keep the browser environment consistent between runs.
  • Use deterministic inputs: hold the data, viewport, device scale factor, timeline window, and relevant user settings constant.
  • Wait on application state: prefer a site-owned ready marker or another condition tied to completed data rendering over a guessed delay.
  • Inspect the image: check for clipped labels, unexpected scrollbars, missing custom content, or a time range that differs from the intended one.
  • Consider custom page content: if the site uses custom item templates or external resources, verify those in the output. The screenshot API captures what the browser has rendered, and the target page’s implementation determines whether those elements are ready and available.

These controls improve repeatability, but do not guarantee pixel-identical results across different browsers or environments. The cited tool documentation describes screenshot capabilities; it does not establish universal rendering parity for every font, animation, custom template, or cross-origin resource. If exact visual comparison matters, use a consistent browser setup and check the actual output in the environment where the comparison runs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo can capture a rendered page with one GET request. For a vis.js page, provide the page URL and use a selector or readiness options as appropriate; the page still needs to initialize the Timeline in the intended state. See the ScreenshotNeo API documentation for request options and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/timeline -o timeline.webp

ScreenshotNeo’s clean-shot steps accept cookie or consent banners like a visitor and remove 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response identifies the page verdict and billing status in response headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Every feature is available on every plan.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Troubleshooting

Symptom Likely cause What to change
Selector timeout or “element not found” The selector does not match this page, or the Timeline has not been added to the DOM. Inspect the target page’s actual markup and pass the correct container selector. If initialization is delayed, wait for an application-specific marker rather than repeatedly increasing the timeout without checking the page.
Image contains an empty chart or few items The capture ran before the site finished loading data or rendering its items. Wait for the page’s data-ready condition, then confirm the intended items are present in the browser before capture.
Wrong date range appears The Timeline retained its default or user-dependent visible window. When you control the application, set the intended range with its Timeline API, such as setWindow, after initialization. Otherwise, use the site controls and verify the visible range.
Labels or items are cut off The selected element boundary or timeline container dimensions do not fit the content. Increase the configured container dimensions or choose a different capture boundary. If the timeline has internal scrolling, adjust its view; a page-level full-page screenshot will not necessarily expand that inner region.
Surrounding controls are missing The capture targeted only the timeline element. Use a viewport screenshot when the context fits on screen, or full-page capture when relevant page content extends below the viewport.
Results differ between runs The page state, dimensions, data, or browser environment changed, or the capture happened at a different readiness point. Fix the viewport and time range, use stable data and a readiness condition, and run with the project’s pinned browser automation setup.
Custom content or external assets do not appear The asset may not have loaded or may depend on site-specific behavior. Check the page in the capture browser and wait for the asset or custom template to be ready. The reviewed documentation does not specify one universal fix for cross-origin resources or custom rendering.

Frequently asked questions

Does a vis.js Timeline need a special screenshot plugin?

No special plugin is required for the general case: the Timeline renders using regular HTML DOM, so browser screenshot APIs can capture the rendered page or element.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Will the screenshot look identical in every browser?

That is not established by the cited documentation. Fonts, animations, browser differences, and site-specific rendering can affect the image, so use a consistent browser environment and verify output when visual parity matters.

Frequently Asked Questions

Does a vis.js Timeline need a special screenshot plugin?

No special plugin is required for the general case: the Timeline renders using regular HTML DOM, so browser screenshot APIs can capture the rendered page or element.

Will the screenshot look identical in every browser?

That is not established by the cited documentation. Fonts, animations, browser differences, and site-specific rendering can affect the image, so use a consistent browser environment and verify output when visual parity matters.

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.