fix(plugin-chart-echarts): support adhoc x-axis (#20055)

* fix(plugin-chart-echarts): support adhoc x-axis

* simplify code
This commit is contained in:
Ville Brofeldt
2022-05-13 16:29:51 +03:00
committed by GitHub
parent 4f77824e55
commit b53daa91ec
7 changed files with 121 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ import {
DataRecordValue,
DTTM_ALIAS,
GenericDataType,
getColumnLabel,
getNumberFormatter,
isEventAnnotationLayer,
isFormulaAnnotationLayer,
@@ -141,7 +142,8 @@ export default function transformProps(
const colorScale = CategoricalColorNamespace.getScale(colorScheme as string);
const rebasedData = rebaseForecastDatum(data, verboseMap);
const xAxisCol = verboseMap[xAxisOrig] || xAxisOrig || DTTM_ALIAS;
const xAxisCol =
verboseMap[xAxisOrig] || getColumnLabel(xAxisOrig || DTTM_ALIAS);
const rawSeries = extractSeries(rebasedData, {
fillNeighborValue: stack && !forecastEnabled ? 0 : undefined,
xAxis: xAxisCol,