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

xAxis "0" not found #14080

Closed
cheqianxiao opened this issue Jan 20, 2021 · 4 comments
Closed

xAxis "0" not found #14080

cheqianxiao opened this issue Jan 20, 2021 · 4 comments
Labels
FAQ v5 Frequent Asked Questions (v5) waiting-for: community

Comments

@cheqianxiao
Copy link

Version

5.0.1

Reproduction link

https://codesandbox.io/s/async-fast-n3sz9?file=/src/index.js

Steps to reproduce

访问reproduction link

What is expected?

正常显示柱图

What is actually happening?

报错: xAxis "0" not found

@echarts-bot
Copy link

echarts-bot bot commented Jan 20, 2021

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 echarts-bot bot added bug pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jan 20, 2021
@susiwen8
Copy link
Contributor

susiwen8 commented Jan 20, 2021

涉及按需加载,文档稍后更新

// const echarts = require("echarts");
import * as echarts from "echarts/core";
import {
  GridComponent,
} from 'echarts/components';
import {
  BarChart,
} from 'echarts/charts';
import {
  CanvasRenderer,
} from 'echarts/renderers';
echarts.use([GridComponent, BarChart, CanvasRenderer]);
var myChart = echarts.init(document.getElementById("main"));
// 指定图表的配置项和数据
var option = {
  title: {
    text: "ECharts 入门示例"
  },
  tooltip: {},
  legend: {
    data: ["销量"]
  },
  xAxis: {
    data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
  },
  yAxis: {},
  series: [
    {
      name: "销量",
      type: "bar",
      data: [5, 20, 36, 10, 10, 20]
    }
  ]
};

myChart.setOption(option);

@susiwen8 susiwen8 added FAQ v5 Frequent Asked Questions (v5) and removed bug pending We are not sure about whether this is a bug/new feature. labels Jan 20, 2021
@pissang
Copy link
Contributor

pissang commented Jan 20, 2021

In addition to @susiwen8 's answer. Since 5.0.1. grid component should be imported explicitly to have extreme tree-shaking.

import "echarts/lib/component/grid";

You can check the import code on the new example page

image

@cheqianxiao
Copy link
Author

ok, thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FAQ v5 Frequent Asked Questions (v5) waiting-for: community
Projects
None yet
Development

No branches or pull requests

3 participants