Turn traffic, CPU, memory, and other measurements into clear time-series charts. Use BamtiGraph in a browser, from TypeScript, or from Go.
- Draw line and area charts from your own data.
- Show daily, weekly, monthly, or yearly views.
- Import CSV files and save charts as PNG images.
- Choose your colors, labels, and time zone.
- Keep charts unbranded or add your own text.
These images were rendered with BamtiGraph using the included sample data.
From the project folder:
npm ci
npm run build
npm run serveOpen http://127.0.0.1:8080. You can change the chart settings, add a custom label, and export an image. The demo uses sample data, not live measurements.
Install the npm package:
npm install bamtigraphThe Deno package name is jsr:@safe/bamtigraph; JSR releases are published separately.
This Node.js example creates a chart and saves it as traffic.png:
import { writeFile } from "node:fs/promises";
import { traffic } from "bamtigraph";
const chart = traffic(
[0, 300, 600],
[180e6, 195e6, 188e6],
[42e6, 45e6, 43e6],
{
title: "My network",
fonts: { mode: "bitmap" },
},
);
await writeFile("traffic.png", chart.toPNG());Replace the arrays with your timestamps, incoming values, and outgoing values. Numeric timestamps are Unix seconds. Use null for a missing reading.
For charts on a web page, follow the browser integration guide.
Try the included example from the project folder:
go run ./examples/quickstart -o traffic.pngTo create a chart from a CSV file:
go run ./cmd/bamtigraph -input examples/traffic.csv -o traffic.pngThe Go package is github.com/gosuda/BamtiGraph. See the Go quickstart source to use it in your application. If Go cannot find a suitable font, add -font /path/to/font.ttf.
No watermark is drawn by default. To add your own text along the right edge:
const branded = chart.with({ watermark: "My network" });
await writeFile("branded.png", branded.toPNG());In Go, set graph.Watermark = "My network", or pass -watermark "My network" to the command-line example. Use BAMTIGRAPH if you want the library name, or an empty string to remove the text.
In the demo, use Custom edge text. You can also change the surrounding page labels in assets/brand.js.
BSD-3-Clause. See LICENSE.


