echarts 自定义y轴坐标

效果图:
这里写图片描述
解决方法图:
这里写图片描述

为了方便大家copy,代码如下:

``      yAxis : {
                    type : 'value',
                                axisLabel:{
                                    formatter: function (value) {
                                    var texts = [];
                                    if(value==1){
                                    texts.push('I');
                                    }
                                    else if (value==2) {
                                    texts.push('II');
                                    }
                                    else if (value==3) {
                                    texts.push('III');
                                    }
                                    else if(value==4){
                                    texts.push('IV');
                                    }
                                    else  if(value==5){
                                    texts.push('V');
                                    }
                                    else  if(value==6){
                                    texts.push('劣V');
                                    }else if(value==0){
                                        texts.push('断流');
                                    }
                                    return texts;
                                    }
                                },
                            },
 

发布了141 篇原创文章 · 获赞 204 · 访问量 118万+

猜你喜欢

转载自blog.csdn.net/qq_36838191/article/details/103875458
今日推荐