mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
refactor: get Axis from a helper function (#21449)
This commit is contained in:
@@ -20,9 +20,7 @@
|
||||
import {
|
||||
AnnotationLayer,
|
||||
CategoricalColorNamespace,
|
||||
DTTM_ALIAS,
|
||||
GenericDataType,
|
||||
getColumnLabel,
|
||||
getNumberFormatter,
|
||||
isEventAnnotationLayer,
|
||||
isFormulaAnnotationLayer,
|
||||
@@ -30,8 +28,9 @@ import {
|
||||
isTimeseriesAnnotationLayer,
|
||||
TimeseriesChartDataResponseResult,
|
||||
t,
|
||||
DTTM_ALIAS,
|
||||
} from '@superset-ui/core';
|
||||
import { isDerivedSeries } from '@superset-ui/chart-controls';
|
||||
import { getAxis, isDerivedSeries } from '@superset-ui/chart-controls';
|
||||
import { EChartsCoreOption, SeriesOption } from 'echarts';
|
||||
import { ZRLineType } from 'echarts/types/src/util/types';
|
||||
import {
|
||||
@@ -149,8 +148,9 @@ 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] || getColumnLabel(xAxisOrig || DTTM_ALIAS);
|
||||
verboseMap[xAxisOrig] || getAxis(chartProps.rawFormData) || DTTM_ALIAS;
|
||||
const isHorizontal = orientation === OrientationType.horizontal;
|
||||
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
|
||||
rebasedData,
|
||||
|
||||
Reference in New Issue
Block a user