dev_docs/lens/table.mdx
import Dataset from './dataset.mdx'; import Breakdown from './breakdown.mdx';
Understanding LensTableConfig in detail
chartType'table'titlestringsplitByLensBreakdownConfig[]breakdownLensBreakdownConfig[]splitBy, but specifically used for creating additional columns based on the breakdown of a particular field. It's useful for comparing metrics across different categories directly within the table. Check breakdown configuration details below.const tableConfig: LensConfig = {
chartType: 'table',
title: 'Table chart',
dataset: {
esql: 'from kibana_sample_data_logs | stats bytes=sum(bytes) by geo.dest, geo.src',
},
splitBy: [
'geo.src'
],
breakdown: [
'geo.dest'
],
value: 'bytes',
};
const configBuilder = new LensConfigBuilder(dataViewsAPI, lensFormulaAPI);
const lensConfig = configBuilder.build(tableConfig, {
timeRange: { from: 'now-1y', to: 'now', type: 'relative' },
embeddable: true,
});