{"record":{"id":"d2667a14f710c373","repo":"plotly/plotly.js","slug":"trace-type-traces-do-not-work-on-axes-with-range","errorCode":null,"errorMessage":"<trace.type> traces do not work on axes with rangebreaks. Setting trace <trace.index> to `visible: false`.","messagePattern":"<trace\\.type> traces do not work on axes with rangebreaks\\. Setting trace <trace\\.index> to `visible: false`\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/plots/cartesian/axis_defaults.js","lineNumber":216,"sourceCode":"\n        if(!containerOut.rangebreaks.length) {\n            delete containerOut.rangebreaks;\n        } else {\n            for(var k = 0; k < containerOut.rangebreaks.length; k++) {\n                if(containerOut.rangebreaks[k].pattern === DAY_OF_WEEK) {\n                    containerOut._hasDayOfWeekBreaks = true;\n                    break;\n                }\n            }\n\n            setConvert(containerOut, layoutOut);\n\n            if(layoutOut._has('scattergl') || layoutOut._has('splom')) {\n                for(var i = 0; i < options.data.length; i++) {\n                    var trace = options.data[i];\n                    if(trace.type === 'scattergl' || trace.type === 'splom') {\n                        trace.visible = false;\n                        Lib.warn(trace.type +\n                            ' traces do not work on axes with rangebreaks.' +\n                            ' Setting trace ' + trace.index + ' to `visible: false`.');\n                    }\n                }\n            }\n        }\n    }\n\n    return containerOut;\n};\n\nfunction rangebreaksDefaults(itemIn, itemOut, containerOut) {\n    function coerce(attr, dflt) {\n        return Lib.coerce(itemIn, itemOut, layoutAttributes.rangebreaks, attr, dflt);\n    }\n\n    var enabled = coerce('enabled');\n","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plots/cartesian/axis_defaults.js#L198-L234","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Switch the affected traces from scattergl to scatter (SVG), which supports rangebreaks.","Remove the rangebreaks from the axis if WebGL performance is required and the breaks are optional.","Split the plot: keep rangebreak-based charts on scatter and use scattergl only on axes without rangebreaks."],"exampleFix":"// before\n{ type: 'scattergl', x: dates, y: vals } with layout.xaxis.rangebreaks\n// after\n{ type: 'scatter', x: dates, y: vals } with layout.xaxis.rangebreaks","handlingStrategy":"validation","validationCode":"function assertRangebreakCompatible(traces, layout) {\n  const hasRangebreaks = ['xaxis','yaxis'].some(a => (layout[a] || {}).rangebreaks && layout[a].rangebreaks.length);\n  if (!hasRangebreaks) return;\n  traces.forEach((t, i) => {\n    if (t.type === 'scattergl' || t.type === 'splom') throw new Error(`trace ${i} (${t.type}) unsupported with rangebreaks`);\n  });\n}\nassertRangebreakCompatible(data, layout);","typeGuard":"const isRangebreakSafeTrace = (t) => !['scattergl','splom'].includes(t && t.type);","tryCatchPattern":null,"preventionTips":["Use scatter (SVG) whenever rangebreaks are configured.","Decide upfront between WebGL performance and rangebreak support — you cannot have both on one axis.","When converting scatter to scattergl, re-check rangebreak settings.","For big datasets with rangebreaks, consider pre-filtering data (e.g. drop weekends) instead of rangebreaks."],"tags":["webgl","rangebreaks","traces"],"backgroundTag":"feature-not-supported-with-rangebreaks","analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}