• echarts的markline的使用 y轴预警线


    代码示例:

    app.title = '坐标轴刻度与标签对齐';
    
    option = {
        color: ['#3398DB'],
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器,坐标轴触发有效
                type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {
                name:'直接访问',
                type:'bar',
                barWidth: '60%',
                data:[10, 52, 200, 334, 390, 330, 220]
            }
        ]
    };
    

     效果图:

    主要代码:(设置预警线值,样式,文本)

     markLine : {
                     symbol:"none",
                
    							/*symbol:"none",               //去掉警戒线最后面的箭头
    							label:{
    								position:"end"   ,       //将警示值放在哪个位置,三个值“start”,"middle","end"  开始  中点 结束
    							
    							
    							},*/
                                data : [{
                                    
    								silent:false,             //鼠标悬停事件  true没有,false有
    								lineStyle:{               //警戒线的样式  ,虚实  颜色
                                        type:"solid",
    									color:"#3398DB",
    								},
    									label:{
    								    position:'end',
    								    formatter:"及格(150)"
    								},
    								yAxis:150         // 警戒线的标注值,可以有多个yAxis,多条警示线   或者采用   {type : 'average', name: '平均值'},type值有  max  min  average,分为最大,最小,平均值
    						      
    							},
    							{
    							 
    								silent:false,             //鼠标悬停事件  true没有,false有
    								lineStyle:{               //警戒线的样式  ,虚实  颜色
                                        type:"solid",
    									color:"#FA3934",
    									
    								},
    								label:{
    								    position:'end',
    								    formatter:"优秀(350)",
    								    fontSize:'8'
    								},
    								yAxis:350           // 警戒线的标注值,可以有多个yAxis,多条警示线   或者采用   {type : 'average', name: '平均值'},type值有  max  min  average,分为最大,最小,平均值
    						 
    							}
    							]
                            }  

     

  • 相关阅读:
    伪造mysql服务端实现任意读取
    客户端session安全问题(flask)
    systemd教程
    MySQL的一些常用基本命令的使用说明
    AMD、CMD、CommonJs和ES6的区别
    for in与for of的区别,以及forEach,map,some,every,filter的区别
    EcmaScript 6 十大常用特性
    单行省略号与多行省略号
    Array.prototype.slice.call()详解及转换数组的方法
    返回顶部
  • 原文地址:https://www.cnblogs.com/zhukaixin/p/11641652.html
Copyright © 2020-2023  润新知