apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.2k stars 19.61k forks source link

散点图不显示 #14072

Closed xwjune closed 1 year ago

xwjune commented 3 years ago

Version

5.0.1

Steps to reproduce

import React, { useEffect } from 'react';
import * as echarts from 'echarts/lib/echarts';
import 'echarts/lib/chart/scatter';
import 'echarts/lib/component/tooltip';

const ScatterChart = () => {
  useEffect(() => {
    const option = {
        tooltip: {
            show: true,
        },
        grid: {
            top: 20,
            bottom: 20,
            left: 20,
            right: 20,
        },
        bmap: {
            center: [120.13066322374, 30.240018034923],
            zoom: 14,
            roam: true,
        },
        series: [{
            type: 'scatter',
            coordinateSystem: 'bmap',
            data: [{
                name: '杭州',
                symbolSize: 20,
                value: [120.149835, 30.250613],
            }],
            itemStyle: {
                color: 'blue'
            },
        }]
    };

    const myChart = echarts.init(document.getElementById('myChart'));
    myChart.setOption(option);
  }, []);

  return (
    <div style={{ width: 400, height: 400 }} id="myChart" />
  );
};

export default ScatterChart;

What is expected?

散点图不显示,地图空白,且已经引入,是不是还需要引入某些特定的组件搭配使用

What is actually happening?

散点图显示


官网的案例代码不够完善,同样的代码拷贝下来,按需加载的时候,因为没有引入必要的组件,图表不一定正确显示,但这些例子里没有很好的体现

echarts-bot[bot] commented 3 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

echarts-bot[bot] commented 3 years ago

@xwjune Please provide a demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , https://www.makeapie.com/editor.html or https://codesandbox.io/s/mystifying-bash-2uthz.

Ovilia commented 3 years ago

建议先完整引入 import * as echarts from 'echarts' 看看有没有问题。可以在 https://www.makeapie.com/editor.html 上复现下问题。

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 1 year ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!