mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: custom SQL in the XAxis (#21847)
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
import {
|
||||
buildQueryContext,
|
||||
ensureIsArray,
|
||||
getXAxis,
|
||||
getXAxisColumn,
|
||||
isXAxisSet,
|
||||
QueryFormData,
|
||||
} from '@superset-ui/core';
|
||||
@@ -35,7 +35,9 @@ export default function buildQuery(formData: QueryFormData) {
|
||||
{
|
||||
...baseQueryObject,
|
||||
columns: [
|
||||
...(isXAxisSet(formData) ? ensureIsArray(getXAxis(formData)) : []),
|
||||
...(isXAxisSet(formData)
|
||||
? ensureIsArray(getXAxisColumn(formData))
|
||||
: []),
|
||||
],
|
||||
...(isXAxisSet(formData) ? {} : { is_timeseries: true }),
|
||||
post_processing: [
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
smartDateVerboseFormatter,
|
||||
NumberFormatter,
|
||||
TimeFormatter,
|
||||
getXAxis,
|
||||
getXAxisLabel,
|
||||
} from '@superset-ui/core';
|
||||
import { EChartsCoreOption, graphic } from 'echarts';
|
||||
import {
|
||||
@@ -102,7 +102,7 @@ export default function transformProps(
|
||||
const { r, g, b } = colorPicker;
|
||||
const mainColor = `rgb(${r}, ${g}, ${b})`;
|
||||
|
||||
const timeColumn = getXAxis(rawFormData) as string;
|
||||
const timeColumn = getXAxisLabel(rawFormData) as string;
|
||||
let trendLineData;
|
||||
let percentChange = 0;
|
||||
let bigNumber = data.length === 0 ? null : data[0][metricName];
|
||||
|
||||
Reference in New Issue
Block a user