Integrate the Lines graph and Scatter (bubble) chart of Apache ECharts.
npm install @naivemap/mapbox-gl-echarts-layerbash
npm i @naivemap/mapbox-gl-echarts-layer echarts
`
Signature:
`typescript
export default class EChartsLayer implements mapboxgl.CustomLayerInterface
`
Implements: mapboxgl.CustomLayerInterface
Constructors
| Constructor | Description |
| --- | --- |
| (constructor)(id: string, option: ECOption) | Constructs a new instance of the EChartsLayer class |
$3
id (string) The ID of the layer.
option (ECOption) The option of the Lines graph and Scatter (bubble) chart.
`ts
export type ECOption = echarts.ComposeOption<
| TitleComponentOption
| TooltipComponentOption
| LegendComponentOption
| LinesSeriesOption
| ScatterSeriesOption
| EffectScatterSeriesOption
>
`
$3
| Method | Description |
| ---------------------------------- | ------------------------------------------------------- |
| setOption (option: ECOption) | Call echartsInstance.setOption() to update the chart. |
Example
`ts
// echart option
const option = {...}
const layer = new EChartsLayer('layer-id', option)
map.addLayer(layer)
``