echarts icon indicating copy to clipboard operation
echarts copied to clipboard

设置axisLabel的show属性为true后报错axisModel.getCategories is not a function

Open shguanbin opened this issue 8 years ago • 3 comments

看到你们说不会更新好失望唉~~~ 一样的问题,设置axisLabel的show属性为true后报错 ,而且无法显示刻度,版本为4.0.4 提示:Error in mounted hook: "TypeError: axisModel.getCategories is not a function"

One-line summary [问题简述]

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:4.0.4
  • Browser version [浏览器类型和版本]:Google Chrome65.0
  • OS Version [操作系统类型和版本]:

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

option = {
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          x: 'right',
          y: 'bottom',
          itemGap: 22,
          data: ['平均分', that.name]
        },
        calculable: true,
        radar: [
          {
            // name: {
            //   show: true,
            //   textStyle: {
            //     color: '#fff',
            //     backgroundColor: '#999',
            //     borderRadius: 3,
            //     padding: [3, 5]
            //   }
            // },
            type: 'polygon',
            indicator: [
              // {text: '米', min: 0, axisLabel: {show: true, textStyle: {fontSize: 18, color: '#333'}}, max: 5},
              {text: '跑', min: 0, max: 5},
              {text: '远', min: 0, max: 5, axisLabel: {show: false}},
              {text: '跳', min: 0, max: 5, axisLabel: {show: false}},
              {text: '网', min: 0, max: 5, axisLabel: {show: false}},
              {text: '坐', min: 0, max: 5, axisLabel: {show: false}},
              {text: '木', min: 0, max: 5, axisLabel: {show: false}}
            ],
            splitArea: { // 底盘样式
              areaStyle: {
                type: 'default',
                color: 'rgb(255, 255, 255)'
              }
            },
            axisLine: {
              lineStyle: {
                color: '#ddd' // 字体颜色
              }
            },
            // axisLabel: {
            //   show: true,
            //   formatter: function (value) {
            //     return value
            //   },
            //   color: 'red'
            // },
            splitLine: {
              lineStyle: { // 线条
                color: '#b6b6b6',
                width: 1
              }
            },
            splitNumber: 5
          }
        ],
        series: [
          {
            type: 'radar',
            data: [
              {
                value: that.averageList,
                name: '平均分',
                itemStyle: {
                  normal: {
                    color: '#fec452' // 数据线条颜色
                  }
                },
                areaStyle: {
                  color: '#fec452' // 数据区域颜色
                }
              },
              {
                value: that.childList,
                name: that.name,
                itemStyle: {
                  normal: {
                    color: '#568cc8' // 数据线条颜色
                  }
                },
                areaStyle: {
                  color: '#568cc8' // 数据区域颜色
                }
              }
            ]
          }
        ]
      }

Other comments [其他信息]

shguanbin avatar Mar 29 '18 13:03 shguanbin

+1 求解决方案

huxiamei avatar Apr 08 '18 11:04 huxiamei

不设置 {text: '米', min: 0, axisLabel: {show: true, textStyle: {fontSize: 18, color: '#333'}}, max: 5}, 直接通过设置

 {text: '跑', min: 0, max: 250, color: 'red'}
改变标签的颜色

Adelaide1014 avatar Apr 10 '18 03:04 Adelaide1014

如果在上面需要加上数字1,2,3,4,5需要怎么弄?

tugenhua0707 avatar Apr 11 '18 06:04 tugenhua0707