bstats-graph-api

Generate bStats chart images on the fly — embed live plugin stats in any README.

Examples

Servers — dark (default)
Players — light
Servers — purple, last 7 days
Players — green, last 7 days
Servers — sketch
Core count — pie chart

How to use

Find the available chart IDs for any plugin:

GET /v1/plugins/{plugin_id}/charts

Embed a chart in your README:

![Servers](https://bstats-graph.gritter.nl/v1/plugins/{plugin_id}/charts/{chart_id}/chart.png)

Pick a theme, then override individual parameters as needed:

?theme=green&width=600&height=200
?theme=purple&max_elements=336
?theme=light&line_color=dc2626

Parameters

dark

theme=dark

Default. Navy background, cyan line.

light

theme=light

White background, blue line.

purple

theme=purple

Deep purple background, purple line.

green

theme=green

Dark green background, emerald line.

sketch

theme=sketch

Paper/hand-drawn style with xkcd font and wobbly lines.

Parameter Default Limits Description
themedarkdark, light, purple, green, sketchColor preset — overridable by any color param below
width830200–2000Image width in px
height315100–1000Image height in px
max_elements14402–17520Data points to fetch (~30 days at default)
bg_colorfrom theme6-char hexBackground color
line_colorfrom theme6-char hexLine color (also base color for pie palettes)
text_colorfrom theme6-char hexAxis label color
grid_colorfrom theme6-char hexGrid line color
filltrueboolFill area under line
fill_alphafrom theme0.0–1.0Fill opacity
line_width2.00.5–5.0Line thickness (line charts only)
titlefrom bStatsmax 100 charsOverride the chart title