f301f07e43
- Convert number chart to aggregate chart - Allow date aggregates on all charts - Only allow `EARLIEST` and `LATEST` on Aggregate chart and Gauge chart - Various design fixes https://github.com/user-attachments/assets/b5a2239d-7b11-48b5-93e6-98ceffae5cab
15 lines
497 B
TypeScript
15 lines
497 B
TypeScript
import { GraphType } from '~/generated/graphql';
|
|
|
|
export const getWidgetTitle = (graphType: GraphType, index: number): string => {
|
|
const baseNames: Record<GraphType, string> = {
|
|
[GraphType.AGGREGATE]: 'Number',
|
|
[GraphType.GAUGE]: 'Gauge',
|
|
[GraphType.PIE]: 'Pie Chart',
|
|
[GraphType.VERTICAL_BAR]: 'Vertical Bar Chart',
|
|
[GraphType.HORIZONTAL_BAR]: 'Horizontal Bar Chart',
|
|
[GraphType.LINE]: 'Line Chart',
|
|
};
|
|
|
|
return `${baseNames[graphType] || 'Widget'} ${index + 1}`;
|
|
};
|