echarts文字居中、旋转、调整位置-前端-E先生的博客
Java
MySQL
大数据
Python
前端
黑科技
大语言模型
    首页 >> 互联网 >> 前端

echarts文字居中、旋转、调整位置

[导读]:function getOption(wachData) {const option = {tooltip: {confine: true,trigger: 'item',enterable: true},angleAxis: {clockwise: true},radar: {splitLine: {lineStyle: {color: ['#fff','#DFDFDF','#DFDFDF','#DFDF...

function getOption(wachData) {

const option = {

tooltip: {

confine: true,

trigger: 'item',

enterable: true

},

angleAxis: {

clockwise: true

},

radar: {

splitLine: {

lineStyle: {

color: [

'#fff',

'#DFDFDF',

'#DFDFDF',

'#DFDFDF',

'#DFDFDF',

'#DFDFDF',

'#DFDFDF',

].reverse()

}

},

radius: 76, //缩放

// startAngle: 160, //旋转

startAngle: -198, //旋转

center: ['50%', '55%'], //位置

axisLine: {

lineStyle: {

type: 'solid',

width: 0.5,

color: "#DFDFDF" //x轴轴线颜色

},

},

splitNumber: 6,

splitArea: {

show: false

// areaStyle: {

// color: ['#f0f1fe', '#e3e4fd', '#D7D9FC', '#E3E4FD', '#c2c6fa']

// }

},

name: {

textStyle: {

fontSize: 13, //字体大小

color: '#333',

padding: [-10, -10] //文字位置

}

},

selectedMode: true,

indicator: [

{

name: '情绪性',

max: 6

}, {

name: '宜人性',

max: 6

}, {

name: '外向性',

max: 6

}, {

name: ' 尽责性',

max: 6

}, {

name: ' 开放性',

max: 6

},

// {

// name: '开放性',

// max: 6

// }, {

// name: '尽责性',

// max: 6

// }, {

// name: '外向性',

// max: 6

// }, {

// name: '宜人性',

// max: 6

// }, {

// name: '情绪性',

// max: 6

// },

],

},

series: [{

name: '性格',

type: 'radar',

symbol: "none",

areaStyle: {

color: 'rgba(100, 112, 253, 0.3)',

},

data: [{

value: wachData?.xdata.reverse() ?? [0, 0, 0, 0, 0],

name: '心理潜质',

itemStyle: {

normal: {

color: '#6470FD',

lineStyle: {

color: '#38FBCD',

},

},

},

}, ]

}, ]

}

return option

}

module.exports = { //必须在这里暴露接口,以便被外界访问,不然就不能访问

getOption: getOption,

}

image.png

本文来自E先生的博客,如若转载,请注明出处:https://www.javajz.cn

留言区

联系人:
手   机:
内   容:
验证码:

历史留言

欢迎加Easy的QQ