{"record":{"id":"1d6e2f7ed14b527e","repo":"plotly/plotly.js","slug":"fixedrange-was-specified-as-false-for-axis-axname","errorCode":null,"errorMessage":"fixedrange was specified as false for axis <axName2> but was overridden because another axis in its constraint group has fixedrange true","messagePattern":"fixedrange was specified as false for axis <axName2> but was overridden because another axis in its constraint group has fixedrange true","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/plots/cartesian/constraints.js","lineNumber":60,"sourceCode":"            for(axId in group) {\n                layoutOut[id2name(axId)][stashAttr] = group;\n            }\n        }\n    }\n    stash(matchGroups, '_matchGroup');\n\n    // If any axis in a constraint group is fixedrange, they all get fixed\n    // This covers matches axes, as they're now in the constraintgroup too\n    // and have not yet been removed (if the group is *only* matching)\n    for(i = 0; i < constraintGroups.length; i++) {\n        group = constraintGroups[i];\n        for(axId in group) {\n            axOut = layoutOut[id2name(axId)];\n            if(axOut.fixedrange) {\n                for(var axId2 in group) {\n                    var axName2 = id2name(axId2);\n                    if((layoutIn[axName2] || {}).fixedrange === false) {\n                        Lib.warn(\n                            'fixedrange was specified as false for axis ' +\n                            axName2 + ' but was overridden because another ' +\n                            'axis in its constraint group has fixedrange true'\n                        );\n                    }\n                    layoutOut[axName2].fixedrange = true;\n                }\n                break;\n            }\n        }\n    }\n\n    // remove constraint groups that simply duplicate match groups\n    i = 0;\n    while(i < constraintGroups.length) {\n        group = constraintGroups[i];\n        for(axId in group) {\n            axOut = layoutOut[id2name(axId)];","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plots/cartesian/constraints.js#L42-L78","documentation":"Within a constraint group (axes linked via scaleanchor/constraint or grid grouping), all axes are scaled together, so one axis having fixedrange: true forces every axis in the group to be fixed. If another axis in the group explicitly declared fixedrange: false, plotly.js warns that this explicit setting is overridden and sets fixedrange: true on it.","triggerScenarios":"Configuring axis A with fixedrange: true and a sibling axis B in the same constraint/scaleanchor group with fixedrange: false, e.g. layout.xaxis2 = {scaleanchor: 'x', fixedrange: false} while xaxis has fixedrange: true.","commonSituations":"Zoom-locking a group with one fixed axis while individually toggling zoom on members; templated layouts where fixedrange: false is set explicitly by a theme/template on all axes.","solutions":["Remove fixedrange: false from axes in groups that contain a fixedrange: true member.","Set fixedrange: true consistently on all axes in the constraint group.","Move the axis out of the constraint group (drop scaleanchor/constraint) if it needs independent zoom."],"exampleFix":"// before\nlayout.xaxis.fixedrange = true;\nlayout.xaxis2 = {scaleanchor: 'x', fixedrange: false};\n// after\nlayout.xaxis.fixedrange = true;\nlayout.xaxis2 = {scaleanchor: 'x', fixedrange: true};","handlingStrategy":"validation","validationCode":"function checkConstraintGroupFixedrange(layout, groupAxes) {\n  const anyFixed = groupAxes.some(a => (layout[a] || {}).fixedrange === true);\n  if (anyFixed) {\n    groupAxes.forEach(a => {\n      if ((layout[a] || {}).fixedrange === false) throw new Error(`${a} has fixedrange:false in a group with a fixed axis`);\n    });\n  }\n}\ncheckConstraintGroupFixedrange(layout, ['xaxis', 'xaxis2']);","typeGuard":"const conflictsWithFixedGroup = (layout, a, group) => (layout[a] || {}).fixedrange === false && group.some(x => (layout[x] || {}).fixedrange === true);","tryCatchPattern":null,"preventionTips":["Treat constraint groups as atomic: one fixedrange policy per group.","Avoid explicitly writing fixedrange: false in shared templates for constrained axes.","Review scaleanchor/constraint links before toggling zoom behavior.","Remove scaleanchor if an axis needs independent zoom."],"tags":["constraints","axes","fixedrange"],"backgroundTag":"conflicting-constraint-group-settings","analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}