@naivemap/mapbox-gl-echarts-layer
v0.3.3
Published
Integrate the Lines graph and Scatter (bubble) chart of Apache ECharts.
Downloads
342
Maintainers
Readme
EChartsLayer class
npm i @naivemap/mapbox-gl-echarts-layer echarts
Signature:
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 |
Parameters
id (string)
The ID of the layer.
option (ECOption)
The option of the Lines graph and Scatter (bubble) chart.
export type ECOption = echarts.ComposeOption<
| TitleComponentOption
| TooltipComponentOption
| LegendComponentOption
| LinesSeriesOption
| ScatterSeriesOption
| EffectScatterSeriesOption
>
Methods
| Method | Description |
| ---------------------------------- | ------------------------------------------------------- |
| setOption (option: ECOption)
| Call echartsInstance.setOption()
to update the chart. |
Example
// echart option
const option = {...}
const layer = new EChartsLayer('layer-id', option)
map.addLayer(layer)