mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
## Summary For ES|QL charts the formula api should be redundant. This is going to make the api lighter as there is no need to import the lens plugin if you want to use the builder to create ES|QL charts.
53 lines
1.3 KiB
Text
53 lines
1.3 KiB
Text
---
|
|
id: kibDevLensConfigAPIRegionMap
|
|
slug: /kibana-dev-docs/lens/config-builder/regionmap
|
|
title: Lens Config Builder API - Region Map
|
|
description: Lens Config Builder API - Region Map
|
|
date: 2024-03-04
|
|
tags: ['kibana', 'dev', 'lens', 'regionmap']
|
|
---
|
|
|
|
import Dataset from './dataset.mdx';
|
|
import Breakdown from './breakdown.mdx';
|
|
|
|
Understanding `LensRegionMapConfig` in detail
|
|
|
|
## Required Properties
|
|
|
|
### `chartType`
|
|
|
|
- **Type:** Fixed value `'regionmap'`
|
|
- **Description:** Sets the chart type to region map, which is used for displaying geographical data across different regions on a map. This visualization type is excellent for spatial analysis, showing how metrics vary across geographic locations.
|
|
|
|
### `title`
|
|
|
|
- **Type:** `string`
|
|
- **Description:** The title of the visualization.
|
|
|
|
<Dataset />
|
|
|
|
<Breakdown />
|
|
|
|
## Optional Properties
|
|
|
|
|
|
|
|
## Example
|
|
|
|
```
|
|
const regionMapConfig: LensConfig = {
|
|
chartType: 'regionmap',
|
|
title: 'Sales by Country',
|
|
dataset: {
|
|
esql: 'from kibana_sample_data_logs | stats bytes=sum(bytes) by geo.dest',
|
|
},
|
|
breakdown: 'geo.dest',
|
|
value: 'bytes',
|
|
};
|
|
const configBuilder = new LensConfigBuilder(dataViewsAPI, lensFormulaAPI);
|
|
const lensConfig = configBuilder.build(regionMapConfig, {
|
|
timeRange: { from: 'now-1y', to: 'now', type: 'relative' },
|
|
embeddable: true,
|
|
});
|
|
```
|
|
|