From 576991823521bb556a4d589d94879567411d4065 Mon Sep 17 00:00:00 2001 From: William Finzer Date: Mon, 23 Sep 2024 11:56:56 -0700 Subject: [PATCH] [#188312576] Bug fix: Date axis not working properly (#1507) * Prior PR for not "shrinking" numeric axes unnecessarily cause date axis model to get spurious min and max. In `graph-model-utils.ts` `setAllowRangeToShrink(true)` was being called for a new numeric axis model, but not for a new date axis model. So, we fix that. --- v3/src/components/graph/models/graph-model-utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/v3/src/components/graph/models/graph-model-utils.ts b/v3/src/components/graph/models/graph-model-utils.ts index 269bc06b7..04b13031c 100644 --- a/v3/src/components/graph/models/graph-model-utils.ts +++ b/v3/src/components/graph/models/graph-model-utils.ts @@ -82,6 +82,7 @@ function setupAxes(graphModel: IGraphContentModel, layout: GraphLayout) { case 'date': { if (!currAxisModel || !isDateAxisModel(currAxisModel)) { const newAxisModel = DateAxisModel.create({place, min: 0, max: 1}) + newAxisModel.setAllowRangeToShrink(true) graphModel?.setAxis(place, newAxisModel) dataConfig?.setAttributeType(attrRole, 'date') layout.setAxisScaleType(place, 'linear')