Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for echarts GEO/map #1

Open
jinfar opened this issue Jan 15, 2024 · 1 comment
Open

Support for echarts GEO/map #1

jinfar opened this issue Jan 15, 2024 · 1 comment

Comments

@jinfar
Copy link

jinfar commented Jan 15, 2024

Describe The Problem To Be Solved

I believe one needs to register an geodata json with registerMap method to create a map chart.

here is an javascript example

var myChart = echarts.init(chartDom);
var option;
$.get('https://echarts.apache.org/examples/data/asset/geo/USA.json', function (usaJson) {
  myChart.hideLoading();
  echarts.registerMap('USA', usaJson, {
    Alaska: {
      left: -131,
      top: 25,
      width: 15
    },
    Hawaii: {
      left: -110,
      top: 28,
      width: 5
    },
    'Puerto Rico': {
      left: -76,
      top: 26,
      width: 2
    }
  });
  option = {
// options
  };
  myChart.setOption(option);
@alxnddr
Copy link
Owner

alxnddr commented Sep 1, 2024

Hi @jinfar 👋 Please try import registerMap from echarts package to register the map you need like this:

import { registerMap } from 'echarts'

echarts.registerMap({...})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants