echarts [Bug] angleAxis.axisLabel.align & angleAxis.axisLabel.verticalAlign not working

lztngnrs  于 3个月前  发布在  Echarts
关注(0)|答案(4)|浏览(45)

Version

5.5.0

Steps to Reproduce

option = {
    "polar": [
        {
            "radius": [
                0,
                186.25
            ]
        },
        {
            "radius": [
                216.25,
                "80%"
            ],
            "tooltip": {
                "trigger": "axis"
            }
        }
    ],
    "radiusAxis": [
        {
            "axisLine": {
                "show": false
            },
            "axisTick": {
                "show": false
            },
            "splitLine": {
                "show": false
            },
            
        },
        {
            "polarIndex": 1,
            "axisLine": {
                "show": false
            },
            "axisTick": {
                "show": false
            },
            "splitLine": {
                "show": false
            },
            "axisLabel": {
                "show": false,
                
            }
        }
    ],
    "angleAxis": [
        {
            "type": "category",
            "axisLabel": {
                "show": false,
                
            },
            "axisLine": {
                "show": false
            },
            "splitLine": {
                "show": false
            }
        },
        {
            "polarIndex": 1,
            "type": "category",
            "axisLine": {
                "show": false
            },
            "boundaryGap": false,
            "splitLine": {
                "show": true,
                "lineStyle": {
                    "type": "dotted"
                }
            },
            "startAngle": 88.2,
            "triggerEvent": true,
            "data": Array.from({
                    length: 100
            },(_,i)=>({
                value: i.toString(),
                textStyle: {
                    fontSize: 12,
                    padding: 0,
                    fontWeight: "normal",
                    backgroundColor: "pink",
                    
                }
            })),
            "axisLabel": {
                "interval": 0,
                verticalAlign: 'middle',
                align: 'center'
            }
        }
    ],
    "tooltip": {
        
    },
    "series": [
        
    ],
    "animation": false
}

Current Behavior

The following configuration items are not working:

  • angleAxis.axisLabel.align
  • angleAxis.axisLabel.verticalAlign

Expected Behavior

Code links:

  • https://github.com/apache/echarts/blob/master/src/component/axis/AngleAxisView.ts#L281
  • https://github.com/apache/echarts/blob/master/src/component/axis/AngleAxisView.ts#L282

After checking the source code, I found that these configuration items are hardcoded in the source, making the option configuration ineffective. If these configuration items are needed, how can they be implemented?

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

cnjp1d6j

cnjp1d6j1#

I'd like to clearify that when align is set to be 'right' , do you expect the label 25 to be displayed at the green position? I can't imagine the real-world case when this is necessary. Can you provide a case when setting it to be left or right to be necessary?

amrnrhlw

amrnrhlw2#

I also think this scenario should not occur in real situations. my requirement is to set both align and verticalAlign to center

I set align and verticalAlign to center mainly to solve the issue of gaps caused by inconsistent calculation rules for positions in different ranges, like this:

If I set them all to center & middle , the gaps will disappear, like this:

mwecs4sa

mwecs4sa3#

If this is the case, maybe it's more important to figure out why the inconsistent happens.

luaexgnf

luaexgnf4#

I think the following code is key:

https://github.com/apache/echarts/blob/master/src/component/axis/AngleAxisView.ts#L259

https://github.com/apache/echarts/blob/master/src/component/axis/AngleAxisView.ts#L261

However, if the configuration items work as documented, this issue can be resolved through configuration.

相关问题