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

雷达图刻度标签显示不出来,js出错:TypeError: e.getCategories is not a function #8020

Closed
sshd123 opened this issue Mar 26, 2018 · 9 comments

Comments

@sshd123
Copy link

sshd123 commented Mar 26, 2018

One-line summary [问题简述]

雷达图刻度显示不出来,js出错:TypeError: e.getCategories is not a function

Version & Environment [版本及环境]

  • ECharts version [4.0.4]:
  • Browser version [chrome 64.0.3282.186]:
  • OS Version [mac10.13.3 ]:

Expected behaviour [期望结果]

雷达图可以显示出刻度值

ECharts option [ECharts配置项]

option = {
title: {
        text: '基础雷达图'
    },
    tooltip: {},
    legend: {
        data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
    },
    radar: {
        // shape: 'circle',
        name: {
            show:true,
            textStyle: {
                color: '#fff',
                backgroundColor: '#999',
                borderRadius: 3,
                padding: [3, 5]
           }
        },
        
        formatter: '{value} kg',
        indicator: [
          { name: '销售(sales)', min:0, max: 6500, axisLabel: { show: true }},
           { name: '管理(Administration)',min:0,  max: 16000},
           { name: '信息技术(Information Techology)',min:0,  max: 30000},
           { name: '客服(Customer Support)', min:0, max: 38000},
           { name: '研发(Development)', min:0, max: 52000},
           { name: '市场(Marketing)', min:0, max: 25000}
        ],
        splitNumber: 10,
        axisLabel: {
                            show: true,
                            inside: true,
                            margin: 10,
                            formatter: '{value} %',
                            textStyle: {
                                fontSize: 2,
                            }
                        }
    },
    series: [{
        name: '预算 vs 开销(Budget vs spending)',
        type: 'radar',
        // areaStyle: {normal: {}},
        data : [
            {
                value : [4300, 10000, 28000, 35000, 50000, 19000],
                name : '预算分配(Allocated Budget)'
            },
             {
                value : [5000, 14000, 28000, 31000, 42000, 21000],
                name : '实际开销(Actual Spending)'
            }
        ]
    }]
}

Other comments [其他信息]

@shguanbin
Copy link

没用哦,按照你们给的参数也是报错 Error in mounted hook: "TypeError: axisModel.getCategories is not a function"
版本是4.0.4

@mike8625
Copy link

mike8625 commented Apr 9, 2018

很奇怪了,我前两天试的报错,还给他们提了bug,今天再试,就没事了,我更新了谷歌到65....

@Adelaide1014
Copy link

axisTick:{ show: true, }添加展示刻度;
TypeError: e.getCategories is not a function报错是因为:

axisLabel: {
                            show: true,
                            inside: true,
                            margin: 10,
                            formatter: '{value} %',
                            textStyle: {
                                fontSize: 2,
                            }
                        }
    },

axisLabe是用来展示刻度的标签的,不是展示刻度的,刻度用标签axisTick控制

@sshd123
Copy link
Author

sshd123 commented Apr 10, 2018

我升级到chrome 65.0.3325.181,还是报同样的错误。
我只是想在雷达图上显示刻度label,但是只要设置axisLabel: {show: true},就会报:TypeError: axisModel.getCategories is not a function

@sshd123 sshd123 changed the title 雷达图刻度显示不出来,js出错:TypeError: e.getCategories is not a function 雷达图刻度标签显示不出来,js出错:TypeError: e.getCategories is not a function Apr 10, 2018
@tugenhua0707
Copy link

是的 ,我的也是chrome65版本 也会报错,我也想显示数字1,2,3,4,5

@huxiamei
Copy link

降echarts.js版本,3.x的就没问题了哦

@ln0909
Copy link

ln0909 commented Sep 5, 2018

3.x, 4.x都试了,还是报错,有其他方法解决吗?

@100pah
Copy link
Member

100pah commented Sep 8, 2018

雷达图并不支持 axisLabel 设置。所有的 axisLabel 都去掉就好了。
(文档里有些错误,我更新下)

@100pah
Copy link
Member

100pah commented May 13, 2019

Fixed in #10036

@100pah 100pah closed this as completed May 13, 2019
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

8 participants