fix(plugin-chart-echarts): support forced categorical x-axis (#26404)

This commit is contained in:
Ville Brofeldt
2024-01-08 12:04:22 -08:00
committed by GitHub
parent 6d58566779
commit 219c4a14b3
23 changed files with 346 additions and 51 deletions

View File

@@ -229,8 +229,10 @@ export function sortRows(
}
const value =
xAxisSortSeries === SortSeriesType.Name && typeof sortKey === 'string'
? sortKey.toLowerCase()
xAxisSortSeries === SortSeriesType.Name
? typeof sortKey === 'string'
? sortKey.toLowerCase()
: sortKey
: aggregate;
return {
@@ -515,8 +517,12 @@ export function sanitizeHtml(text: string): string {
export function getAxisType(
stack: StackType,
forceCategorical?: boolean,
dataType?: GenericDataType,
): AxisType {
if (forceCategorical) {
return AxisType.category;
}
if (dataType === GenericDataType.TEMPORAL) {
return AxisType.time;
}