mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
SYNC: timeline chart type
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user