SYNC: timeline chart type

This commit is contained in:
Jan Prochazka
2025-07-02 08:19:21 +02:00
committed by Diflow
parent f14e4fe197
commit c10a84fc79
2 changed files with 7 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
export type ChartTypeEnum = 'bar' | 'line' | 'pie' | 'polarArea';
export type ChartTypeEnum = 'bar' | 'line' | 'timeline' | 'pie' | 'polarArea';
export type ChartXTransformFunction =
| 'identity'
| 'date:minute'

View File

@@ -126,7 +126,7 @@ export class ChartProcessor {
) {
usedChart = {
definition: {
chartType: 'line',
chartType: 'timeline',
xdef: {
field: datecol,
transformFunction: 'date:day',
@@ -192,6 +192,9 @@ export class ChartProcessor {
if (this.chartsProcessing[i].errorMessage) {
continue; // skip charts with errors
}
if (this.chartsProcessing[i].definition.chartType != 'timeline') {
continue; // skip non-timeline charts
}
this.chartsProcessing[i] = autoAggregateCompactTimelineChart(this.chartsProcessing[i]);
}
@@ -244,7 +247,7 @@ export class ChartProcessor {
const sortOrder = chart.definition.xdef.sortOrder ?? 'ascKeys';
if (sortOrder != 'natural') {
if (sortOrder == 'ascKeys' || sortOrder == 'descKeys') {
if (chart.definition.chartType == 'line' && chart.definition.xdef.transformFunction.startsWith('date:')) {
if (chart.definition.chartType == 'timeline' && chart.definition.xdef.transformFunction.startsWith('date:')) {
addedChart = autoAggregateCompactTimelineChart(addedChart);
fillChartTimelineBuckets(addedChart);
}
@@ -253,7 +256,7 @@ export class ChartProcessor {
this.charts.push(addedChart);
continue;
}
''
addedChart.bucketKeysOrdered = _sortBy([...addedChart.bucketKeysSet]);
if (sortOrder == 'descKeys') {
addedChart.bucketKeysOrdered.reverse();