美文网首页
echarts 自定义y轴坐标

echarts 自定义y轴坐标

作者: royalx | 来源:发表于2019-08-11 20:04 被阅读0次

效果图:


image.png

解决方法图:


image.png
为了方便大家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;
                                    }
                                },
                            },

相关文章

网友评论

      本文标题:echarts 自定义y轴坐标

      本文链接:https://www.haomeiwen.com/subject/hinsjctx.html