plotly/plotly.js · warning

<trace.type> traces do not work on axes with rangebreaks. Se

Error message

<trace.type> traces do not work on axes with rangebreaks. Setting trace <trace.index> to `visible: false`.

What it means

scattergl and splom traces rely on WebGL rendering that does not support axes with rangebreaks. When the layout defines rangebreaks on a cartesian axis and such traces are present, plotly.js disables the trace by setting visible: false and warns that it was skipped rather than rendering incorrectly.

Source

Thrown at src/plots/cartesian/axis_defaults.js:216

        if(!containerOut.rangebreaks.length) {
            delete containerOut.rangebreaks;
        } else {
            for(var k = 0; k < containerOut.rangebreaks.length; k++) {
                if(containerOut.rangebreaks[k].pattern === DAY_OF_WEEK) {
                    containerOut._hasDayOfWeekBreaks = true;
                    break;
                }
            }

            setConvert(containerOut, layoutOut);

            if(layoutOut._has('scattergl') || layoutOut._has('splom')) {
                for(var i = 0; i < options.data.length; i++) {
                    var trace = options.data[i];
                    if(trace.type === 'scattergl' || trace.type === 'splom') {
                        trace.visible = false;
                        Lib.warn(trace.type +
                            ' traces do not work on axes with rangebreaks.' +
                            ' Setting trace ' + trace.index + ' to `visible: false`.');
                    }
                }
            }
        }
    }

    return containerOut;
};

function rangebreaksDefaults(itemIn, itemOut, containerOut) {
    function coerce(attr, dflt) {
        return Lib.coerce(itemIn, itemOut, layoutAttributes.rangebreaks, attr, dflt);
    }

    var enabled = coerce('enabled');

View on GitHub (pinned to 1d090e0b5f)

Solutions

  1. Switch the affected traces from scattergl to scatter (SVG), which supports rangebreaks.
  2. Remove the rangebreaks from the axis if WebGL performance is required and the breaks are optional.
  3. Split the plot: keep rangebreak-based charts on scatter and use scattergl only on axes without rangebreaks.

Example fix

// before
{ type: 'scattergl', x: dates, y: vals } with layout.xaxis.rangebreaks
// after
{ type: 'scatter', x: dates, y: vals } with layout.xaxis.rangebreaks
Defensive patterns

Strategy: validation

Validate before calling

function assertRangebreakCompatible(traces, layout) {
  const hasRangebreaks = ['xaxis','yaxis'].some(a => (layout[a] || {}).rangebreaks && layout[a].rangebreaks.length);
  if (!hasRangebreaks) return;
  traces.forEach((t, i) => {
    if (t.type === 'scattergl' || t.type === 'splom') throw new Error(`trace ${i} (${t.type}) unsupported with rangebreaks`);
  });
}
assertRangebreakCompatible(data, layout);

Type guard

const isRangebreakSafeTrace = (t) => !['scattergl','splom'].includes(t && t.type);

Prevention

When it happens

Trigger: Using layout.xaxis.rangebreaks (or y) together with scattergl or splom traces, e.g. a financial chart that hides weekends via rangebreaks but renders the series with scattergl for performance.

Common situations: Large scatter datasets rendered with scattergl plus date-axis rangebreaks (weekends/holidays); SPLOM dashboards with rangebreaks; switching a working scatter chart to scattergl and suddenly the trace disappears.

Related errors


AI-assisted analysis of plotly/plotly.js@1d090e0b5f (2026-09-02). Data as JSON: /api/errors/d2667a14f710c373. Report an issue: GitHub.