Skip to content

YTed/tianditu-echarts-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a Plugin to embed echarts into Tianditu, developed based on echarts.bmap extension and Tianditu's HeatMapOverlay.

Usage

  • Simply import echarts.tianditu.js in your html header;
  • Instantiate a T.EChartsOverlay and add it to your map with T.Map.addOverLay;
  • Define your echarts option, if your data are coordinate-related, set coordinateSystem as 'tianditu':
  • Add a section of tianditu to your option, use overlayIndex field to connect the EChartsOverlay instantiated above:
var config = {};
var overlay = T.EChartsOverlay(config);
map.addOverlay(overlay);

var option = {
  // ...
  tianditu: {
    overlayIndex: overlay.getIndex(),  // IMPORTANT !!
    center: [113.6253, 34.7466],       // optional
    zoom: 5,                           // optional
  },
  series: [
    {
      name: 'your series name',
      type: 'your series type',
      coordinateSystem: 'tianditu',    // IMPORTANT if you want to display spatial data on map.
      data: [],                        // your series data
    },
    // ...
  ]
  // ...
}

overlay.initializeECharts(option);
  • Initialize echarts with the option defined above, with T.EChartsOverlay.initializeECharts
  • Done.

About

A plugin for embedding echarts into tianditu

Resources

License

Stars

Watchers

Forks

Packages

No packages published