Skip to content

Add bar chart support#192

Open
AerWyn81 wants to merge 7 commits into
Bastian:masterfrom
AerWyn81:feat/advanced-bar-charts
Open

Add bar chart support#192
AerWyn81 wants to merge 7 commits into
Bastian:masterfrom
AerWyn81:feat/advanced-bar-charts

Conversation

@AerWyn81
Copy link
Copy Markdown

@AerWyn81 AerWyn81 commented May 25, 2026

Hi! bStats already defines the simple_bar / advanced_bar chart types (and the
Metrics classes can send them), but the data processor ignored incoming bar data
and the UI didn't let you create such charts. This PR adds end-to-end support.

Data processor

  • Process simple_bar / advanced_bar submissions and store them in Redis as
    data:{<serviceId>}.<chartId>.<tms2000> (hash), with fields
    <category>:<barIndex> accumulated via HINCRBY — matching the format the
    backend already reads in getBarChartData.
  • Simple and advanced bars share the same path (a simple bar is just one value
    per category).
  • Add an integration test (processes_bar_charts) with its snapshot and fixtures.

Web

  • Add a "Bar charts" group (Simple bar / Advanced bar) to the add-chart form,
    schema and action.
  • Hide the filter section for bar charts (no per-bar filtering).
  • Fix bar rendering: the backend returns one entry per category
    ({ name, data: [...] }), so transpose it into series (categories = map keys,
    each bar index = one series). Without this, categories were wrongly used as
    series too.
  • Show a "No data available yet" placeholder for empty bar charts instead of an
    empty/broken chart.
  • Hide the legend when there is only one series.
  • Label the value axis "Servers" (in bStats a bar value is always a server count).
  • Advanced bars: let users define per-bar labels with drag-and-drop reordering
    (add / edit / remove). Labels map by index; missing ones fall back to
    "Series N" and extra ones are ignored.
image image image

You can see the integration in my plugin, which already supports uploading bar charts.


Side note: setting up the dev environment went smoothly overall. The only hiccup
was seeding; the populator timed out for me, so I seeded the data manually.
Thanks for the platform, it's really handy, and looking forward to future
features!

@Bastian
Copy link
Copy Markdown
Owner

Bastian commented May 29, 2026

Thank you for the PR!

I'm currently on vacation and will review it as soon as I'm back 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants