diff --git a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Unit_Of_Time.png b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Unit_Of_Time.png index a64238cf27a7b7d047b8ed3d44817365524effdf..b1413ce116caa419f235e7dd4f6308333f4f2b9f 100644 Binary files a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Unit_Of_Time.png and b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Unit_Of_Time.png differ diff --git a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png index 075a0dd2e86cf7ba4f0acd614c294efcf931d7fb..e4beb375e61fd2788ff02cf2dd999ff338dd4d89 100644 Binary files a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png and b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png differ diff --git a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png index be11694112ff76eae0283f6cc8fd13e469e51a56..83d5faf678a552807636c751b75a9392e7423852 100644 Binary files a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png and b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Single.png differ diff --git a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png index 24555314c4bdb7d11846c69253374cd4cbc1b815..32f849590b17b3833c26d9e2c8eb410537ed5d86 100644 Binary files a/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png and b/.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png differ diff --git a/.loki/reference/chrome_laptop_static_viz_ComboChart_Offset_Based_Timezone_47835.png b/.loki/reference/chrome_laptop_static_viz_ComboChart_Offset_Based_Timezone_47835.png new file mode 100644 index 0000000000000000000000000000000000000000..159762180a8fef9f70966b784034e1ccba689d12 Binary files /dev/null and b/.loki/reference/chrome_laptop_static_viz_ComboChart_Offset_Based_Timezone_47835.png differ diff --git a/frontend/src/metabase/static-viz/components/ComboChart/ComboChart.stories.tsx b/frontend/src/metabase/static-viz/components/ComboChart/ComboChart.stories.tsx index 36915b7a09bfa90edbf66fc47fc4bba7326ee677..110049b6c0441dd17b3657dab9db20e65213c536 100644 --- a/frontend/src/metabase/static-viz/components/ComboChart/ComboChart.stories.tsx +++ b/frontend/src/metabase/static-viz/components/ComboChart/ComboChart.stories.tsx @@ -39,7 +39,6 @@ const renderingContext: RenderingContext = { export const LineLinearXScale = { render: Template, - args: { rawSeries: data.lineLinearXScale as any, renderingContext, @@ -48,7 +47,6 @@ export const LineLinearXScale = { export const LineLinearXScaleUnsorted = { render: Template, - args: { rawSeries: data.lineLinearXScaleUnsorted as any, renderingContext, @@ -57,7 +55,6 @@ export const LineLinearXScaleUnsorted = { export const LogYScaleCustomYAxisRange = { render: Template, - args: { rawSeries: data.logYScaleCustomYAxisRange as any, renderingContext, @@ -66,7 +63,6 @@ export const LogYScaleCustomYAxisRange = { export const PowYScaleCustomYAxisRange = { render: Template, - args: { rawSeries: data.powYScaleCustomYAxisRange as any, renderingContext, @@ -75,7 +71,6 @@ export const PowYScaleCustomYAxisRange = { export const LineLogYScale = { render: Template, - args: { rawSeries: data.lineLogYScale as any, renderingContext, @@ -84,7 +79,6 @@ export const LineLogYScale = { export const GoalLineLogYScale = { render: Template, - args: { rawSeries: data.goalLineLogYScale as any, renderingContext, @@ -93,7 +87,6 @@ export const GoalLineLogYScale = { export const GoalLinePowYScale = { render: Template, - args: { rawSeries: data.goalLinePowYScale as any, renderingContext, @@ -102,7 +95,6 @@ export const GoalLinePowYScale = { export const LineLogYScaleNegative = { render: Template, - args: { rawSeries: data.lineLogYScaleNegative as any, renderingContext, @@ -111,7 +103,6 @@ export const LineLogYScaleNegative = { export const LineShowDotsAuto = { render: Template, - args: { rawSeries: data.lineShowDotsAuto as any, renderingContext, @@ -120,7 +111,6 @@ export const LineShowDotsAuto = { export const LineShowDotsOn = { render: Template, - args: { rawSeries: data.lineShowDotsOn as any, renderingContext, @@ -129,7 +119,6 @@ export const LineShowDotsOn = { export const LineShowDotsOff = { render: Template, - args: { rawSeries: data.lineShowDotsOff as any, renderingContext, @@ -138,7 +127,6 @@ export const LineShowDotsOff = { export const LineCustomYAxisRangeEqualsExtents = { render: Template, - args: { rawSeries: data.lineCustomYAxisRangeEqualsExtents as any, renderingContext, @@ -147,7 +135,6 @@ export const LineCustomYAxisRangeEqualsExtents = { export const CustomYAxisRangeWithColumnScaling = { render: Template, - args: { rawSeries: data.customYAxisRangeWithColumnScaling as any, renderingContext, @@ -156,7 +143,6 @@ export const CustomYAxisRangeWithColumnScaling = { export const LineFullyNullDimension37902 = { render: Template, - args: { rawSeries: data.lineFullyNullDimension37902 as any, renderingContext, @@ -165,7 +151,6 @@ export const LineFullyNullDimension37902 = { export const AreaFullyNullDimension37902 = { render: Template, - args: { rawSeries: data.areaFullyNullDimension37902 as any, renderingContext, @@ -174,7 +159,6 @@ export const AreaFullyNullDimension37902 = { export const BarLinearXScale = { render: Template, - args: { rawSeries: data.barLinearXScale as any, renderingContext, @@ -183,7 +167,6 @@ export const BarLinearXScale = { export const BarHistogramXScale = { render: Template, - args: { rawSeries: data.barHistogramXScale as any, renderingContext, @@ -192,7 +175,6 @@ export const BarHistogramXScale = { export const BarHistogramMultiSeries = { render: Template, - args: { rawSeries: data.barHistogramMultiSeries as any, renderingContext, @@ -201,7 +183,6 @@ export const BarHistogramMultiSeries = { export const BarHistogramMultiSeriesBinned = { render: Template, - args: { rawSeries: data.barHistogramMultiSeriesBinned as any, renderingContext, @@ -210,7 +191,6 @@ export const BarHistogramMultiSeriesBinned = { export const BarHistogramSeriesBreakout = { render: Template, - args: { rawSeries: data.barHistogramSeriesBreakout as any, renderingContext, @@ -219,7 +199,6 @@ export const BarHistogramSeriesBreakout = { export const BarHistogramStacked = { render: Template, - args: { rawSeries: data.barHistogramStacked as any, renderingContext, @@ -228,7 +207,6 @@ export const BarHistogramStacked = { export const BarHistogramStackedNormalized = { render: Template, - args: { rawSeries: data.barHistogramStackedNormalized as any, renderingContext, @@ -237,7 +215,6 @@ export const BarHistogramStackedNormalized = { export const BarHistogramUnaggregatedDimension = { render: Template, - args: { rawSeries: data.barHistogramUnaggregatedDimension as any, renderingContext, @@ -246,7 +223,6 @@ export const BarHistogramUnaggregatedDimension = { export const BarOrdinalXScale = { render: Template, - args: { rawSeries: data.barOrdinalXScale as any, renderingContext, @@ -255,7 +231,6 @@ export const BarOrdinalXScale = { export const BarOrdinalXScaleAutoRotatedLabels = { render: Template, - args: { rawSeries: data.barOrdinalXScaleAutoRotatedLabels as any, renderingContext, @@ -264,7 +239,6 @@ export const BarOrdinalXScaleAutoRotatedLabels = { export const BarStackedTotalFormattedValues = { render: Template, - args: { rawSeries: data.barStackedTotalFormattedValues as any, renderingContext, @@ -273,7 +247,6 @@ export const BarStackedTotalFormattedValues = { export const BarStackedPowYAxis = { render: Template, - args: { rawSeries: data.barStackedPowYAxis as any, renderingContext, @@ -282,7 +255,6 @@ export const BarStackedPowYAxis = { export const BarStackedPowYAxisNegatives = { render: Template, - args: { rawSeries: data.barStackedPowYAxisNegatives as any, renderingContext, @@ -291,7 +263,6 @@ export const BarStackedPowYAxisNegatives = { export const YAxisCompactWithoutDataLabels = { render: Template, - args: { rawSeries: data.yAxisCompactWithoutDataLabels as any, renderingContext, @@ -300,7 +271,6 @@ export const YAxisCompactWithoutDataLabels = { export const BarFormattingFull = { render: Template, - args: { rawSeries: data.barFormattingFull as any, renderingContext, @@ -309,7 +279,6 @@ export const BarFormattingFull = { export const BarAutoFormattingCompact = { render: Template, - args: { rawSeries: data.barAutoFormattingCompact as any, renderingContext, @@ -318,7 +287,6 @@ export const BarAutoFormattingCompact = { export const BarAutoFormattingFull = { render: Template, - args: { rawSeries: data.barAutoFormattingFull as any, renderingContext, @@ -328,7 +296,6 @@ export const BarAutoFormattingFull = { export const BarLogYScaleStacked = { render: Template, - args: { rawSeries: data.barLogYScaleStacked as any, renderingContext, @@ -337,7 +304,6 @@ export const BarLogYScaleStacked = { export const BarLogYScaleStackedNegative = { render: Template, - args: { rawSeries: data.barLogYScaleStackedNegative as any, renderingContext, @@ -346,7 +312,6 @@ export const BarLogYScaleStackedNegative = { export const BarStackedNormalizedEmptySpace37880 = { render: Template, - args: { rawSeries: data.barStackedNormalizedEmptySpace37880 as any, renderingContext, @@ -355,7 +320,6 @@ export const BarStackedNormalizedEmptySpace37880 = { export const BarTwoAxesStackedWithNegativeValues = { render: Template, - args: { rawSeries: data.barTwoAxesStackedWithNegativeValues as any, renderingContext, @@ -364,7 +328,6 @@ export const BarTwoAxesStackedWithNegativeValues = { export const BarBreakoutWithLineSeriesStackedRightAxisOnly = { render: Template, - args: { rawSeries: data.barBreakoutWithLineSeriesStackedRightAxisOnly as any, renderingContext, @@ -373,7 +336,6 @@ export const BarBreakoutWithLineSeriesStackedRightAxisOnly = { export const BarsBreakoutSortedWithNegativeValuesPowerYAxis = { render: Template, - args: { rawSeries: data.barsBreakoutSortedWithNegativeValuesPowerYAxis as any, renderingContext, @@ -382,7 +344,6 @@ export const BarsBreakoutSortedWithNegativeValuesPowerYAxis = { export const BarFullyNullDimension37902 = { render: Template, - args: { rawSeries: data.barFullyNullDimension37902 as any, renderingContext, @@ -391,7 +352,6 @@ export const BarFullyNullDimension37902 = { export const SplitYAxis = { render: Template, - args: { rawSeries: data.autoYSplit as any, renderingContext, @@ -400,7 +360,6 @@ export const SplitYAxis = { export const GoalLineOutOfBounds37848 = { render: Template, - args: { rawSeries: data.goalLineOutOfBounds37848 as any, renderingContext, @@ -409,7 +368,6 @@ export const GoalLineOutOfBounds37848 = { export const GoalLineUnderSeries38824 = { render: Template, - args: { rawSeries: data.goalLineUnderSeries38824 as any, renderingContext, @@ -418,7 +376,6 @@ export const GoalLineUnderSeries38824 = { export const GoalVerySmall = { render: Template, - args: { rawSeries: data.goalVerySmall as any, renderingContext, @@ -427,7 +384,6 @@ export const GoalVerySmall = { export const GoalBetweenExtentAndChartBound = { render: Template, - args: { rawSeries: data.goalBetweenExtentAndChartBound as any, renderingContext, @@ -436,7 +392,6 @@ export const GoalBetweenExtentAndChartBound = { export const GoalLineDisabled = { render: Template, - args: { rawSeries: data.goalLineDisabled as any, renderingContext, @@ -445,7 +400,6 @@ export const GoalLineDisabled = { export const TrendSingleSeriesLine = { render: Template, - args: { rawSeries: data.trendSingleSeriesLine as any, renderingContext, @@ -454,7 +408,6 @@ export const TrendSingleSeriesLine = { export const TrendMultiSeriesLine = { render: Template, - args: { rawSeries: data.trendMultiSeriesLine as any, renderingContext, @@ -463,7 +416,6 @@ export const TrendMultiSeriesLine = { export const TrendSingleSeriesArea = { render: Template, - args: { rawSeries: data.trendSingleSeriesArea as any, renderingContext, @@ -472,7 +424,6 @@ export const TrendSingleSeriesArea = { export const TrendMultiSeriesArea = { render: Template, - args: { rawSeries: data.trendMultiSeriesArea as any, renderingContext, @@ -481,7 +432,6 @@ export const TrendMultiSeriesArea = { export const TrendMultiSeriesStackedArea = { render: Template, - args: { rawSeries: data.trendMultiSeriesStackedArea as any, renderingContext, @@ -490,7 +440,6 @@ export const TrendMultiSeriesStackedArea = { export const TrendMultiSeriesNormalizedStackedArea = { render: Template, - args: { rawSeries: data.trendMultiSeriesNormalizedStackedArea as any, renderingContext, @@ -499,7 +448,6 @@ export const TrendMultiSeriesNormalizedStackedArea = { export const TrendSingleSeriesBar = { render: Template, - args: { rawSeries: data.trendSingleSeriesBar as any, renderingContext, @@ -508,7 +456,6 @@ export const TrendSingleSeriesBar = { export const TrendMultiSeriesBar = { render: Template, - args: { rawSeries: data.trendMultiSeriesBar as any, renderingContext, @@ -517,7 +464,6 @@ export const TrendMultiSeriesBar = { export const TrendMultiSeriesStackedBar = { render: Template, - args: { rawSeries: data.trendMultiSeriesStackedBar as any, renderingContext, @@ -526,7 +472,6 @@ export const TrendMultiSeriesStackedBar = { export const TrendMultiSeriesNormalizedStackedBar = { render: Template, - args: { rawSeries: data.trendMultiSeriesNormalizedStackedBar as any, renderingContext, @@ -535,7 +480,6 @@ export const TrendMultiSeriesNormalizedStackedBar = { export const TrendCombo = { render: Template, - args: { rawSeries: data.trendCombo as any, renderingContext, @@ -544,7 +488,6 @@ export const TrendCombo = { export const TrendComboPower = { render: Template, - args: { rawSeries: data.trendComboPower as any, renderingContext, @@ -553,7 +496,6 @@ export const TrendComboPower = { export const TrendComboLog = { render: Template, - args: { rawSeries: data.trendComboLog as any, renderingContext, @@ -562,7 +504,6 @@ export const TrendComboLog = { export const ComboHistogram = { render: Template, - args: { rawSeries: data.comboHistogram as any, renderingContext, @@ -571,7 +512,6 @@ export const ComboHistogram = { export const CombinedBarTimeSeriesDifferentGranularityWithBreakout = { render: Template, - args: { rawSeries: data.combinedBarTimeSeriesDifferentGranularityWithBreakout as any, @@ -581,7 +521,6 @@ export const CombinedBarTimeSeriesDifferentGranularityWithBreakout = { export const NumericXAxisIncludesZero37082 = { render: Template, - args: { rawSeries: data.numericXAxisIncludesZero37082 as any, renderingContext, @@ -590,7 +529,6 @@ export const NumericXAxisIncludesZero37082 = { export const WrongYAxisRange37306 = { render: Template, - args: { rawSeries: data.wrongYAxisRange37306 as any, renderingContext, @@ -599,7 +537,6 @@ export const WrongYAxisRange37306 = { export const LongDimensionNameCutOff37420 = { render: Template, - args: { rawSeries: data.longDimensionNameCutOff37420 as any, renderingContext, @@ -608,7 +545,6 @@ export const LongDimensionNameCutOff37420 = { export const CompactXAxisDoesNotWork38917 = { render: Template, - args: { rawSeries: data.compactXAxisDoesNotWork38917 as any, renderingContext, @@ -617,7 +553,6 @@ export const CompactXAxisDoesNotWork38917 = { export const DataLabelsUnderTrendGoalLines41280 = { render: Template, - args: { rawSeries: data.dataLabelsUnderTrendGoalLines41280 as any, renderingContext, @@ -626,7 +561,6 @@ export const DataLabelsUnderTrendGoalLines41280 = { export const TicksNativeWeekWithGapShortRange = { render: Template, - args: { rawSeries: data.ticksNativeWeekWithGapShortRange as any, renderingContext, @@ -635,7 +569,6 @@ export const TicksNativeWeekWithGapShortRange = { export const TicksNativeWeekWithGapLongRange = { render: Template, - args: { rawSeries: data.ticksNativeWeekWithGapLongRange as any, renderingContext, @@ -644,7 +577,6 @@ export const TicksNativeWeekWithGapLongRange = { export const BarStackLinearXAxis = { render: Template, - args: { rawSeries: data.barStackLinearXAxis as any, renderingContext, @@ -653,7 +585,6 @@ export const BarStackLinearXAxis = { export const AreaStackLinearXAxis = { render: Template, - args: { rawSeries: data.areaStackLinearXAxis as any, renderingContext, @@ -662,7 +593,6 @@ export const AreaStackLinearXAxis = { export const NullCategoryValueFormatting = { render: Template, - args: { rawSeries: data.nullCategoryValueFormatting as any, renderingContext, @@ -671,7 +601,6 @@ export const NullCategoryValueFormatting = { export const NumberOfInsightsError39608 = { render: Template, - args: { rawSeries: data.numberOfInsightsError39608 as any, renderingContext, @@ -680,7 +609,6 @@ export const NumberOfInsightsError39608 = { export const AreaStackInterpolateMissingValues = { render: Template, - args: { rawSeries: data.areaStackInterpolateMissingValues as any, renderingContext, @@ -689,7 +617,6 @@ export const AreaStackInterpolateMissingValues = { export const AreaStackAllSeriesWithoutInterpolation = { render: Template, - args: { rawSeries: data.areaStackAllSeriesWithoutInterpolation as any, renderingContext, @@ -698,7 +625,6 @@ export const AreaStackAllSeriesWithoutInterpolation = { export const AreaOverBar = { render: Template, - args: { rawSeries: data.areaOverBar as any, renderingContext, @@ -707,7 +633,6 @@ export const AreaOverBar = { export const TimeSeriesTicksCompactFormattingMixedTimezones = { render: Template, - args: { rawSeries: data.timeSeriesTicksCompactFormattingMixedTimezones as any, renderingContext, @@ -716,7 +641,6 @@ export const TimeSeriesTicksCompactFormattingMixedTimezones = { export const TimezoneTicksPlacement = { render: Template, - args: { rawSeries: data.timezoneTicksPlacement as any, renderingContext, @@ -725,7 +649,6 @@ export const TimezoneTicksPlacement = { export const BarRelativeDatetimeOrdinalScale = { render: Template, - args: { rawSeries: data.barRelativeDatetimeOrdinalScale as any, renderingContext, @@ -734,7 +657,6 @@ export const BarRelativeDatetimeOrdinalScale = { export const BarTwoDaysOfWeek = { render: Template, - args: { rawSeries: data.barTwoDaysOfWeek as any, renderingContext, @@ -743,7 +665,6 @@ export const BarTwoDaysOfWeek = { export const AreaStackedAutoDataLabels = { render: Template, - args: { rawSeries: data.areaStackedAutoDataLabels as any, renderingContext, @@ -752,7 +673,6 @@ export const AreaStackedAutoDataLabels = { export const ImageCutOff37275 = { render: Template, - args: { rawSeries: data.imageCutOff37275 as any, renderingContext, @@ -761,7 +681,6 @@ export const ImageCutOff37275 = { export const IncorrectLabelYAxisSplit41285 = { render: Template, - args: { rawSeries: data.incorrectLabelYAxisSplit41285 as any, renderingContext, @@ -770,7 +689,6 @@ export const IncorrectLabelYAxisSplit41285 = { export const NativeAutoYSplit = { render: Template, - args: { rawSeries: data.nativeAutoYSplit as any, renderingContext, @@ -779,7 +697,6 @@ export const NativeAutoYSplit = { export const TimeSeriesYyyymmddNumbersFormat = { render: Template, - args: { rawSeries: data.timeSeriesYyyymmddNumbersFormat as any, renderingContext, @@ -788,7 +705,6 @@ export const TimeSeriesYyyymmddNumbersFormat = { export const BreakoutNullAndEmptyString = { render: Template, - args: { rawSeries: data.breakoutNullAndEmptyString as any, renderingContext, @@ -797,7 +713,6 @@ export const BreakoutNullAndEmptyString = { export const NoGoodAxisSplit = { render: Template, - args: { rawSeries: data.noGoodAxisSplit as any, renderingContext, @@ -806,7 +721,6 @@ export const NoGoodAxisSplit = { export const HistogramTicks45Degrees = { render: Template, - args: { rawSeries: data.histogramTicks45Degrees as any, renderingContext, @@ -815,7 +729,6 @@ export const HistogramTicks45Degrees = { export const HistogramTicks90Degrees = { render: Template, - args: { rawSeries: data.histogramTicks90Degrees as any, renderingContext, @@ -824,7 +737,6 @@ export const HistogramTicks90Degrees = { export const LineUnpinFromZero = { render: Template, - args: { rawSeries: data.lineUnpinFromZero as any, renderingContext, @@ -833,7 +745,6 @@ export const LineUnpinFromZero = { export const LineSettings = { render: Template, - args: { rawSeries: data.lineSettings as any, renderingContext, @@ -842,7 +753,6 @@ export const LineSettings = { export const LineReplaceMissingValuesZero = { render: Template, - args: { rawSeries: data.lineReplaceMissingValuesZero as any, renderingContext, @@ -851,7 +761,6 @@ export const LineReplaceMissingValuesZero = { export const LineChartBrokenDimensionsMetricsSettings = { render: Template, - args: { rawSeries: data.lineChartBrokenDimensionsMetricsSettings as any, renderingContext, @@ -860,7 +769,6 @@ export const LineChartBrokenDimensionsMetricsSettings = { export const ComboStackedBarsAreasNormalized = { render: Template, - args: { rawSeries: data.comboStackedBarsAreasNormalized as any, renderingContext, @@ -869,7 +777,6 @@ export const ComboStackedBarsAreasNormalized = { export const ComboStackedBarsAreas = { render: Template, - args: { rawSeries: data.comboStackedBarsAreas as any, renderingContext, @@ -878,7 +785,6 @@ export const ComboStackedBarsAreas = { export const TwoBarsTwoAreasOneLineLinear = { render: Template, - args: { rawSeries: data.twoBarsTwoAreasOneLineLinear as any, renderingContext, @@ -887,7 +793,6 @@ export const TwoBarsTwoAreasOneLineLinear = { export const TwoBarsTwoAreasOneLinePower = { render: Template, - args: { rawSeries: data.twoBarsTwoAreasOneLinePower as any, renderingContext, @@ -896,7 +801,6 @@ export const TwoBarsTwoAreasOneLinePower = { export const TwoBarsTwoAreasOneLineLog = { render: Template, - args: { rawSeries: data.twoBarsTwoAreasOneLineLog as any, renderingContext, @@ -905,7 +809,6 @@ export const TwoBarsTwoAreasOneLineLog = { export const BarCorrectWidthWhenTwoYAxes = { render: Template, - args: { rawSeries: data.barCorrectWidthWhenTwoYAxes as any, renderingContext, @@ -914,7 +817,6 @@ export const BarCorrectWidthWhenTwoYAxes = { export const BarDataLabelsNegatives = { render: Template, - args: { rawSeries: data.barDataLabelsNegatives as any, renderingContext, @@ -923,7 +825,6 @@ export const BarDataLabelsNegatives = { export const BarStackedNormalizedSeriesLabels = { render: Template, - args: { rawSeries: data.barStackedNormalizedSeriesLabels as any, renderingContext, @@ -932,7 +833,6 @@ export const BarStackedNormalizedSeriesLabels = { export const BarStackedSeriesLabelsAndTotals = { render: Template, - args: { rawSeries: data.barStackedSeriesLabelsAndTotals as any, renderingContext, @@ -941,7 +841,6 @@ export const BarStackedSeriesLabelsAndTotals = { export const BarStackedSeriesLabelsNoTotals = { render: Template, - args: { rawSeries: data.barStackedSeriesLabelsNoTotals as any, renderingContext, @@ -950,7 +849,6 @@ export const BarStackedSeriesLabelsNoTotals = { export const BarStackedSeriesLabelsRotated = { render: Template, - args: { rawSeries: data.barStackedSeriesLabelsRotated as any, renderingContext, @@ -959,7 +857,6 @@ export const BarStackedSeriesLabelsRotated = { export const BarStackedSeriesLabelsAutoCompactness = { render: Template, - args: { rawSeries: data.barStackedSeriesLabelsAutoCompactness as any, renderingContext, @@ -968,7 +865,6 @@ export const BarStackedSeriesLabelsAutoCompactness = { export const BarStackedSeriesLabelsAndTotalsOrdinal = { render: Template, - args: { rawSeries: data.barStackedSeriesLabelsAndTotalsOrdinal as any, renderingContext, @@ -977,7 +873,6 @@ export const BarStackedSeriesLabelsAndTotalsOrdinal = { export const BarStackedSeriesLabelsNormalizedAutoCompactness = { render: Template, - args: { rawSeries: data.barStackedSeriesLabelsNormalizedAutoCompactness as any, renderingContext, @@ -986,7 +881,6 @@ export const BarStackedSeriesLabelsNormalizedAutoCompactness = { export const BarStackedLabelsNullVsZero = { render: Template, - args: { rawSeries: data.barStackedLabelsNullVsZero as any, renderingContext, @@ -995,7 +889,6 @@ export const BarStackedLabelsNullVsZero = { export const BarMinHeightLimit = { render: Template, - args: { rawSeries: data.barMinHeightLimit as any, renderingContext, @@ -1004,7 +897,6 @@ export const BarMinHeightLimit = { export const ComboDataLabelsAutoCompactnessPropagatesFromLine = { render: Template, - args: { rawSeries: data.comboDataLabelsAutoCompactnessPropagatesFromLine as any, renderingContext, @@ -1013,7 +905,6 @@ export const ComboDataLabelsAutoCompactnessPropagatesFromLine = { export const ComboDataLabelsAutoCompactnessPropagatesFromTotals = { render: Template, - args: { rawSeries: data.comboDataLabelsAutoCompactnessPropagatesFromTotals as any, renderingContext, @@ -1022,7 +913,6 @@ export const ComboDataLabelsAutoCompactnessPropagatesFromTotals = { export const AreaChartSteppedNullsInterpolated = { render: Template, - args: { rawSeries: data.areaChartSteppedNullsInterpolated as any, renderingContext, @@ -1031,7 +921,6 @@ export const AreaChartSteppedNullsInterpolated = { export const AreaChartSteppedNullsSkipped = { render: Template, - args: { rawSeries: data.areaChartSteppedNullsSkipped as any, renderingContext, @@ -1040,7 +929,6 @@ export const AreaChartSteppedNullsSkipped = { export const SafariNonIanaTimezoneRepro44128 = { render: Template, - args: { rawSeries: data.safariNonIanaTimezoneRepro44128 as any, renderingContext, @@ -1049,7 +937,6 @@ export const SafariNonIanaTimezoneRepro44128 = { export const CombinedWithInvalidSettings = { render: Template, - args: { rawSeries: data.combinedWithInvalidSettings as any, renderingContext, @@ -1058,7 +945,6 @@ export const CombinedWithInvalidSettings = { export const StackedChartCustomYAxisRange = { render: Template, - args: { rawSeries: data.stackedChartCustomYAxisRange as any, renderingContext, @@ -1067,7 +953,6 @@ export const StackedChartCustomYAxisRange = { export const SeriesOrderSettingsDoNotMatchSeriesCount = { render: Template, - args: { rawSeries: data.seriesOrderSettingsDoNotMatchSeriesCount as any, renderingContext, @@ -1076,7 +961,6 @@ export const SeriesOrderSettingsDoNotMatchSeriesCount = { export const TrendGoalLinesWithScalingPowScaleCustomRange = { render: Template, - args: { rawSeries: data.trendGoalLinesWithScalingPowScaleCustomRange as any, renderingContext, @@ -1085,16 +969,22 @@ export const TrendGoalLinesWithScalingPowScaleCustomRange = { export const BarStackedAllLabelsTimeseriesWithGap45717 = { render: Template, - args: { rawSeries: data.barStackedAllLabelsTimeseriesWithGap45717 as any, renderingContext, }, }; -export const Default = { +export const OffsetBasedTimezone47835 = { render: Template, + args: { + rawSeries: data.offsetBasedTimezone47835 as any, + renderingContext, + }, +}; +export const Default = { + render: Template, args: { rawSeries: data.messedUpAxis as any, renderingContext, diff --git a/frontend/src/metabase/static-viz/components/ComboChart/stories-data/index.ts b/frontend/src/metabase/static-viz/components/ComboChart/stories-data/index.ts index 365699b4316f3b22c63c406769fd83dc26ba21c9..d6a3293f551c9dfcdaefe263144012774a3d0fa6 100644 --- a/frontend/src/metabase/static-viz/components/ComboChart/stories-data/index.ts +++ b/frontend/src/metabase/static-viz/components/ComboChart/stories-data/index.ts @@ -91,6 +91,7 @@ import noGoodAxisSplit from "./no-good-axis-split.json"; import nullCategoryValueFormatting from "./null-category-value-formatting.json"; import numberOfInsightsError39608 from "./number-of-insights-error-39608.json"; import numericXAxisIncludesZero37082 from "./numeric-x-axis-includes-zero-37082.json"; +import offsetBasedTimezone47835 from "./offset-based-timezone-47835.json"; import powYScaleCustomYAxisRange from "./pow-y-scale-custom-y-axis-range.json"; import safariNonIanaTimezoneRepro44128 from "./safari-non-iana-timezone-repro-44128.json"; import seriesOrderSettingsDoNotMatchSeriesCount from "./series-order-settings-do-not-match-series-count.json"; @@ -236,4 +237,5 @@ export const data = { seriesOrderSettingsDoNotMatchSeriesCount, trendGoalLinesWithScalingPowScaleCustomRange, barStackedAllLabelsTimeseriesWithGap45717, + offsetBasedTimezone47835, }; diff --git a/frontend/src/metabase/static-viz/components/ComboChart/stories-data/offset-based-timezone-47835.json b/frontend/src/metabase/static-viz/components/ComboChart/stories-data/offset-based-timezone-47835.json new file mode 100644 index 0000000000000000000000000000000000000000..d243e72fc31ce6e9ce8499be3480aa83d352b293 --- /dev/null +++ b/frontend/src/metabase/static-viz/components/ComboChart/stories-data/offset-based-timezone-47835.json @@ -0,0 +1,266 @@ +[ + { + "card": { + "original_card_id": 556, + "can_delete": false, + "public_uuid": null, + "parameter_usage_count": 0, + "created_at": "2024-10-01T19:34:48.001925Z", + "parameters": [], + "metabase_version": "v0.1.37-SNAPSHOT (c38c478)", + "collection": { + "metabase.models.collection.root/is-root?": true, + "authority_level": null, + "name": "Our analytics", + "is_personal": false, + "id": "root", + "can_write": true + }, + "visualization_settings": { + "table.cell_column": "HourNumber", + "graph.dimensions": ["DatetimeHour"], + "graph.metrics": ["HourNumber"] + }, + "collection_preview": true, + "entity_id": "wIneCe559aa9P1B8sxlfD", + "archived_directly": false, + "display": "bar", + "parameter_mappings": [], + "id": 556, + "dataset_query": { + "database": 4, + "type": "native", + "native": { + "template-tags": {}, + "query": "DECLARE @date_var DATETIME\nSELECT @date_var = '2024-09-01 00:00'\n\n;WITH Dates AS\n(\n SELECT DATEPART(HOUR,@date_var) [Hour], \n @date_var DatetimeHour, 0 HourNumber\n UNION ALL\n SELECT DATEPART(HOUR,DATEADD(HOUR,1,DatetimeHour)), \n DATEADD(HOUR,1,DatetimeHour), HourNumber+1\n FROM Dates\n WHERE HourNumber < 23\n)\nSELECT HourNumber, DatetimeHour\nFROM Dates\norder by DatetimeHour asc" + } + }, + "cache_ttl": null, + "embedding_params": null, + "made_public_by_id": null, + "updated_at": "2024-10-01T19:41:19.387667Z", + "moderation_reviews": [], + "can_restore": false, + "creator_id": 1, + "average_query_time": 140.2, + "type": "question", + "last_used_at": "2024-10-02T23:32:27.702646Z", + "dashboard_count": 0, + "last_query_start": "2024-10-02T23:32:27.673477Z", + "name": "47835 mssql", + "query_type": "native", + "collection_id": null, + "enable_embedding": false, + "database_id": 4, + "trashed_from_collection_id": null, + "can_write": true, + "initially_published_at": null, + "result_metadata": [ + { + "display_name": "HourNumber", + "field_ref": [ + "field", + "HourNumber", + { + "base-type": "type/Integer" + } + ], + "base_type": "type/Integer", + "effective_type": "type/Integer", + "name": "HourNumber", + "semantic_type": "type/Quantity", + "fingerprint": { + "global": { + "distinct-count": 24, + "nil%": 0 + }, + "type": { + "type/Number": { + "min": 0, + "q1": 5.5, + "q3": 17.5, + "max": 23, + "sd": 7.0710678118654755, + "avg": 11.5 + } + } + } + }, + { + "display_name": "DatetimeHour", + "field_ref": [ + "field", + "DatetimeHour", + { + "base-type": "type/DateTime" + } + ], + "base_type": "type/DateTime", + "effective_type": "type/DateTime", + "name": "DatetimeHour", + "semantic_type": null, + "fingerprint": { + "global": { + "distinct-count": 24, + "nil%": 0 + }, + "type": { + "type/DateTime": { + "earliest": "2024-09-01T00:00:00+13:00", + "latest": "2024-09-01T23:00:00+13:00" + } + } + } + } + ], + "can_run_adhoc_query": true, + "table_id": null, + "source_card_id": null, + "collection_position": null, + "view_count": 12, + "archived": false, + "description": null, + "cache_invalidated_at": null, + "displayIsLocked": true + }, + "data": { + "rows": [ + [0, "2024-09-01T00:00:00+13:00"], + [1, "2024-09-01T01:00:00+13:00"], + [2, "2024-09-01T02:00:00+13:00"], + [3, "2024-09-01T03:00:00+13:00"], + [4, "2024-09-01T04:00:00+13:00"], + [5, "2024-09-01T05:00:00+13:00"], + [6, "2024-09-01T06:00:00+13:00"], + [7, "2024-09-01T07:00:00+13:00"], + [8, "2024-09-01T08:00:00+13:00"], + [9, "2024-09-01T09:00:00+13:00"], + [10, "2024-09-01T10:00:00+13:00"], + [11, "2024-09-01T11:00:00+13:00"], + [12, "2024-09-01T12:00:00+13:00"], + [13, "2024-09-01T13:00:00+13:00"], + [14, "2024-09-01T14:00:00+13:00"], + [15, "2024-09-01T15:00:00+13:00"], + [16, "2024-09-01T16:00:00+13:00"], + [17, "2024-09-01T17:00:00+13:00"], + [18, "2024-09-01T18:00:00+13:00"], + [19, "2024-09-01T19:00:00+13:00"], + [20, "2024-09-01T20:00:00+13:00"], + [21, "2024-09-01T21:00:00+13:00"], + [22, "2024-09-01T22:00:00+13:00"], + [23, "2024-09-01T23:00:00+13:00"] + ], + "cols": [ + { + "display_name": "HourNumber", + "source": "native", + "field_ref": [ + "field", + "HourNumber", + { + "base-type": "type/Integer" + } + ], + "name": "HourNumber", + "base_type": "type/Integer", + "database_type": "int", + "effective_type": "type/Integer" + }, + { + "display_name": "DatetimeHour", + "source": "native", + "field_ref": [ + "field", + "DatetimeHour", + { + "base-type": "type/DateTime" + } + ], + "name": "DatetimeHour", + "base_type": "type/DateTime", + "database_type": "datetime", + "effective_type": "type/DateTime" + } + ], + "native_form": { + "params": null, + "query": "DECLARE @date_var DATETIME\nSELECT @date_var = '2024-09-01 00:00'\n\n;WITH Dates AS\n(\n SELECT DATEPART(HOUR,@date_var) [Hour], \n @date_var DatetimeHour, 0 HourNumber\n UNION ALL\n SELECT DATEPART(HOUR,DATEADD(HOUR,1,DatetimeHour)), \n DATEADD(HOUR,1,DatetimeHour), HourNumber+1\n FROM Dates\n WHERE HourNumber < 23\n)\nSELECT HourNumber, DatetimeHour\nFROM Dates\norder by DatetimeHour asc" + }, + "format-rows?": true, + "results_timezone": "+13:00", + "requested_timezone": "+13:00", + "results_metadata": { + "columns": [ + { + "display_name": "HourNumber", + "field_ref": [ + "field", + "HourNumber", + { + "base-type": "type/Integer" + } + ], + "base_type": "type/Integer", + "effective_type": "type/Integer", + "name": "HourNumber", + "semantic_type": "type/Quantity", + "fingerprint": { + "global": { + "distinct-count": 24, + "nil%": 0 + }, + "type": { + "type/Number": { + "min": 0, + "q1": 5.5, + "q3": 17.5, + "max": 23, + "sd": 7.0710678118654755, + "avg": 11.5 + } + } + } + }, + { + "display_name": "DatetimeHour", + "field_ref": [ + "field", + "DatetimeHour", + { + "base-type": "type/DateTime" + } + ], + "base_type": "type/DateTime", + "effective_type": "type/DateTime", + "name": "DatetimeHour", + "semantic_type": null, + "fingerprint": { + "global": { + "distinct-count": 24, + "nil%": 0 + }, + "type": { + "type/DateTime": { + "earliest": "2024-09-01T00:00:00+13:00", + "latest": "2024-09-01T23:00:00+13:00" + } + } + } + } + ] + }, + "insights": [ + { + "previous-value": 22, + "unit": "hour", + "offset": -479194.9999924746, + "last-change": 0.045454545454545456, + "col": "HourNumber", + "slope": 23.999999999623117, + "last-value": 23, + "best-fit": ["+", -479194.9999924746, ["*", 23.999999999623117, "x"]] + } + ] + } + } +] diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/model/axis.ts b/frontend/src/metabase/visualizations/echarts/cartesian/model/axis.ts index 42c8579003669bb30a94d02e8e2beb2e8316f828..fc61e851b92c2db39ceaf0f41b10d4141ce97e46 100644 --- a/frontend/src/metabase/visualizations/echarts/cartesian/model/axis.ts +++ b/frontend/src/metabase/visualizations/echarts/cartesian/model/axis.ts @@ -701,12 +701,12 @@ export function getTimeSeriesXAxisModel( return null; } - const dateInTimezone = - offsetMinutes != null - ? date.add(offsetMinutes, "minute") - : date.tz(timezone); - - return dateInTimezone.format("YYYY-MM-DDTHH:mm:ss[Z]"); + // Safari doesn't support offset-based timezones (e.g., "+07:00") in the Date object, + // which Day.js relies on. To avoid runtime exceptions, we manually adjust the time + // when an offset is provided. Otherwise, we use Day.js timezone conversion. + return offsetMinutes != null + ? date.add(offsetMinutes, "minute").format() + : date.tz(timezone).format("YYYY-MM-DDTHH:mm:ss[Z]"); }; const fromEChartsAxisValue = (rawValue: number) => { return dayjs.utc(rawValue);