kibana/x-pack/plugins/lens/public/pie_visualization/constants.ts
Marco Liberati 03cc5cc0c2
[Lens] Introduces new chart switcher (#91844)
Co-authored-by: Wylie Conlon <wylieconlon@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-02 11:25:35 +01:00

47 lines
1.2 KiB
TypeScript

/*
* 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';
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: {
icon: LensIconChartDonut,
label: i18n.translate('xpack.lens.pie.donutLabel', {
defaultMessage: 'Donut',
}),
groupLabel,
},
pie: {
icon: LensIconChartPie,
label: i18n.translate('xpack.lens.pie.pielabel', {
defaultMessage: 'Pie',
}),
groupLabel,
},
treemap: {
icon: LensIconChartTreemap,
label: i18n.translate('xpack.lens.pie.treemaplabel', {
defaultMessage: 'Treemap',
}),
groupLabel,
},
};
export const MAX_PIE_BUCKETS = 3;
export const MAX_TREEMAP_BUCKETS = 2;
export const DEFAULT_PERCENT_DECIMALS = 2;