Skip to content

Commit

Permalink
fix 🐛: min x value came from the data instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
squiles committed Dec 11, 2024
1 parent f938a52 commit 7695a01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/charts/shared/chart-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ export const useNumericalXVariables = (
const getMinX = useCallback(
(data: Observation[], _getX: NumericalValueGetter) => {
switch (chartType) {
case "scatterplot":
case "bar":
return Math.min(0, min(data, _getX) ?? 0);
case "scatterplot":
return shouldUseDynamicMinScaleValue(xMeasure.scaleType)
? min(data, _getX) ?? 0
: Math.min(0, min(data, _getX) ?? 0);
Expand Down

0 comments on commit 7695a01

Please sign in to comment.