echarts 雷达图没有clockwise选项,不能设置顺时针排列

mw3dktmi  于 2022-11-03  发布在  Echarts
关注(0)|答案(5)|浏览(582)

One-line summary [问题简述]

雷达图默认为逆时针,没有设置为顺时针排列的选项

Version & Environment [版本及环境]

  • ECharts version [3.4.0]:
  • Browser version [Chrome最新内核]:
  • OS Version [Win10]:

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

option ={
    "tooltip": {
        "show": false
    },
    "toolbox": {
        "feature": {
            "dataView": {},
            "saveAsImage": {}
        }
    },
    "radar": {
        "indicator": [
            {
                "name": "躯体化",
                "min": 1,
                "max": 5
            },
            {
                "name": "强迫症状",
                "min": 1,
                "max": 5
            },
            {
                "name": "人际敏感",
                "min": 1,
                "max": 5
            },
            {
                "name": "抑郁",
                "min": 1,
                "max": 5
            },
            {
                "name": "焦虑",
                "min": 1,
                "max": 5
            },
            {
                "name": "敌对",
                "min": 1,
                "max": 5
            },
            {
                "name": "恐怖",
                "min": 1,
                "max": 5
            },
            {
                "name": "偏执",
                "min": 1,
                "max": 5
            },
            {
                "name": "精神病性",
                "min": 1,
                "max": 5
            },
            {
                "name": "其他",
                "min": 1,
                "max": 5
            }
        ]
    },
    "series": [
        {
            "type": "radar",
            "areaStyle": {
                "normal": {}
            },
            "data": [
                {
                    "value": [
                        2.83,
                        2.1,
                        3,
                        2.62,
                        2.9,
                        2.17,
                        2.14,
                        2.83,
                        2.9,
                        2.29
                    ]
                }
            ]
        }
    ]
}

Other comments [其他信息]

vqlkdk9b

vqlkdk9b1#

直到现在都没有解决方案?????

z6psavjg

z6psavjg2#

大哥,请问解决了吗,具体是那个配置项,把数据改成逆时针的也是醉了,正常不都顺时针?

g52tjvyc

g52tjvyc4#

没有找到更好的方法了,竟然没有顺时针的配置项,逆向思维呀

let { indicator, radardata } = this.props

      indicator && indicator.reverse()

      radardata[0].value && radardata[0].value.reverse()

      let offest = 360 / (indicator.length)

      let newOption = {
        radar: {
          radius: '70%',
          name: {
            textStyle: {
              color: '#999',
            }
          },
          startAngle: 90 + offest,
          indicator: indicator
        },

        series: [{
          type: 'radar',
          data: radardata,
          label: {
            show: true,
            formatter: function (params) {
              return params.value;
            }
          }
        }]
      };
xj3cbfub

xj3cbfub5#

It's make no sense to manually arrange data for clockwise arrangement. Please add clockwise option to radar!

相关问题