Skip to content

Commit

Permalink
[#188312576] Bug fix: Date axis not working properly (#1507)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
bfinzer authored Sep 23, 2024
1 parent cf366b9 commit 5769918
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions v3/src/components/graph/models/graph-model-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5769918

Please sign in to comment.