kibana/x-pack/plugins/lens/public/pie_visualization/constants.ts

47 lines
1.2 KiB
TypeScript
Raw Normal View History

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { i18n } from '@kbn/i18n';
2020-09-15 11:24:02 +02:00
import { LensIconChartDonut } from '../assets/chart_donut';
import { LensIconChartPie } from '../assets/chart_pie';
import { LensIconChartTreemap } from '../assets/chart_treemap';
const groupLabel = i18n.translate('xpack.lens.pie.groupLabel', {
defaultMessage: 'Proportion',
});
export const CHART_NAMES = {
donut: {
2020-09-15 11:24:02 +02:00
icon: LensIconChartDonut,
label: i18n.translate('xpack.lens.pie.donutLabel', {
defaultMessage: 'Donut',
}),
groupLabel,
},
pie: {
2020-09-15 11:24:02 +02:00
icon: LensIconChartPie,
label: i18n.translate('xpack.lens.pie.pielabel', {
defaultMessage: 'Pie',
}),
groupLabel,
},
treemap: {
2020-09-15 11:24:02 +02:00
icon: LensIconChartTreemap,
label: i18n.translate('xpack.lens.pie.treemaplabel', {
defaultMessage: 'Treemap',
}),
groupLabel,
},
};
export const MAX_PIE_BUCKETS = 3;
export const MAX_TREEMAP_BUCKETS = 2;
2020-09-15 11:24:02 +02:00
export const DEFAULT_PERCENT_DECIMALS = 2;