【发布时间】:2022-07-21 18:53:44
【问题描述】:
我在 geo json 文件中有一张地图,我需要将其用于高图。如何使用我在 highcharts 中创建的 geojson 地图,而不是在 highcharts 中使用给定的地图。**
【问题讨论】:
标签: highcharts geojson
我在 geo json 文件中有一张地图,我需要将其用于高图。如何使用我在 highcharts 中创建的 geojson 地图,而不是在 highcharts 中使用给定的地图。**
【问题讨论】:
标签: highcharts geojson
您需要使用Highcharts.geojson 方法重构一个GeoJSON 对象,以准备被series.mapData 选项直接读取。
const states = Highcharts.geojson(geojson, 'map'),
rivers = Highcharts.geojson(geojson, 'mapline'),
cities = Highcharts.geojson(geojson, 'mappoint');
现场演示: https://jsfiddle.net/BlackLabel/gqebvL2t/
API 参考: https://api.highcharts.com/class-reference/Highcharts#.geojson
【讨论】: