echarts icon indicating copy to clipboard operation
echarts copied to clipboard

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

Open sshd123 opened this issue 8 years ago • 9 comments

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 [其他信息]

sshd123 avatar Mar 26 '18 06:03 sshd123

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

shguanbin avatar Mar 29 '18 13:03 shguanbin

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

mike8625 avatar Apr 09 '18 03:04 mike8625

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

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

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

Adelaide1014 avatar Apr 10 '18 08:04 Adelaide1014

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

sshd123 avatar Apr 10 '18 09:04 sshd123

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

tugenhua0707 avatar Apr 11 '18 06:04 tugenhua0707

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

huxiamei avatar Apr 11 '18 07:04 huxiamei

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

ln0909 avatar Sep 05 '18 07:09 ln0909

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

100pah avatar Sep 08 '18 15:09 100pah

Fixed in #10036

100pah avatar May 13 '19 11:05 100pah