mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix(plugin-chart-echarts): normalize temporal string groupbys (#24134)
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
NumberFormatter,
|
||||
TimeFormatter,
|
||||
SupersetTheme,
|
||||
normalizeTimestamp,
|
||||
} from '@superset-ui/core';
|
||||
import { SortSeriesType } from '@superset-ui/chart-controls';
|
||||
import { format, LegendComponentOption, SeriesOption } from 'echarts';
|
||||
@@ -336,7 +337,12 @@ export function formatSeriesName(
|
||||
return name.toString();
|
||||
}
|
||||
if (name instanceof Date || coltype === GenericDataType.TEMPORAL) {
|
||||
const d = name instanceof Date ? name : new Date(name);
|
||||
const normalizedName =
|
||||
typeof name === 'string' ? normalizeTimestamp(name) : name;
|
||||
const d =
|
||||
normalizedName instanceof Date
|
||||
? normalizedName
|
||||
: new Date(normalizedName);
|
||||
|
||||
return timeFormatter ? timeFormatter(d) : d.toISOString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user