Forum Discussion

mia_qbeeq's avatar
04-08-2026

Widget script: hide value labels and empty legend items on native bar and column charts

Hey everyone 👋

Ever built a stacked bar or column chart and found yourself wishing you could just... turn the labels off? Maybe you've got a lot of segments, and they're all squishing together, or the chart just doesn't have quite enough room to breathe in your dashboard layout, and the labels end up overlapping and making things harder to read rather than easier.

Or, does it bother you that your legend still shows entries for categories that have no data at all for certain dimension values? So you've got these ghost entries sitting in the legend that don't correspond to anything visible in the chart.

Sisense doesn't have a native toggle for either of these, so here's a widget script that handles both. It works on bar and column charts (stacked or single value) and does two things:

  • Hides the value labels from displaying on the bars or columns
  • Removes any series from the legend if all of its values are null or zero
widget.on("beforeviewloaded", function(w, args){
var allEmpty = arr => arr.every(v => v.y === null || v.y === 0);

for (e in args.options.series) {
var serie = args.options.series[e];

if (allEmpty(serie.data)) {
serie.showInLegend = false;
}
}

});

A few situations where this comes in handy:

  • You have a stacked chart with a lot of segments where the labels are colliding with each other
  • Your dashboard is on the tighter side, and there just isn't room to make the chart large enough for labels to display cleanly
  • Your legend is cluttered with entries for categories that have no data for certain dimension values, which can confuse users into thinking something is missing
  • The chart is more of a visual overview and the exact values aren't the point, users can always hover for tooltips anyway
  • You just prefer a cleaner, less noisy look overall

Nothing groundbreaking, just a handy little script if you've ever hit this wall. 

Mia from QBeeQ, a Sisense Gold Implementation Partnerwww.qbeeq.io

No RepliesBe the first to reply