feat: generate consistent QueryObject whether GenericAxis is enabled or disabled (#21519)

This commit is contained in:
Yongjie Zhao
2022-09-21 09:41:21 +08:00
committed by GitHub
parent 6644a84f79
commit 4d12e3709e
22 changed files with 474 additions and 65 deletions

View File

@@ -28,9 +28,9 @@ import {
isTimeseriesAnnotationLayer,
TimeseriesChartDataResponseResult,
t,
DTTM_ALIAS,
getXAxis,
} from '@superset-ui/core';
import { getAxis, isDerivedSeries } from '@superset-ui/chart-controls';
import { isDerivedSeries } from '@superset-ui/chart-controls';
import { EChartsCoreOption, SeriesOption } from 'echarts';
import { ZRLineType } from 'echarts/types/src/util/types';
import {
@@ -148,9 +148,7 @@ export default function transformProps(
const colorScale = CategoricalColorNamespace.getScale(colorScheme as string);
const rebasedData = rebaseForecastDatum(data, verboseMap);
// todo: if the both granularity_sqla and x_axis are `null`, should throw an error
const xAxisCol =
verboseMap[xAxisOrig] || getAxis(chartProps.rawFormData) || DTTM_ALIAS;
const xAxisCol = getXAxis(chartProps.rawFormData) as string;
const isHorizontal = orientation === OrientationType.horizontal;
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
rebasedData,