e-Charts y轴没有split,且刻度值没显示出来,铺助线的精度没能按照设定的来

涛声依旧4210 发布于 2015/05/20 13:57
阅读 526
收藏 0
 

E-chart 折线图问题,希望各位大神有时间的话回复一下,谢谢!问题如下:

1.y轴的data范围为:0.042~0.062之间,我设置了MAX,MIN属性,也设置了scale:true,但Y轴并没有根据这些值来split,并且Y轴上也没有刻度值

2.markLine中计算平均值只保留了两位小数,我设置了presicion为4,也没起作用。

如图:

var option = {
    title : {
        text: "Monitor  CHART ",
  textStyle : {
        fontSize: 18,
        fontWeight: 'bolder',
        color: 'rgb(60,179,113)'
    }   
    },
    tooltip : {
        trigger: 'axis'
    },
    legend: {
     backgroundColor : 'rgb(224,255,255)',
        data:['upper','lower','upperCl','lowerCl','target','Value']
    },
   
    toolbox: {
        show : true,
        orient : 'vertical',
        x: 'right',
        y: 'center',
        feature : {
            mark : {show: true},
            magicType : {show: true, type: ['line', 'bar']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
   
    dataZoom : {   //selection data area
        show : true,
        fillerColor: 'rgb(192,192,192)',
        handleColor: 'rgb(46,139,87)',
        realtime: false,
        start : 0,
        end : 25
    },       

    calculable : false,
    xAxis : [
        {
            type : 'category',  
            splitArea : {show : true},  //分割页面内信息
            data: ${xData?default("[]")}
        }
    ],
    yAxis : [
        {
            type : 'value',
            boundaryGap: [0.01,0.01],
            min: 0.03,
            max: 0.07,
            splitLine: {
               show: true
           },
           scale: true

        }
    ],
    series : [
        {
            name:'upperSpec',
            type:'line',       
          itemStyle: {
                normal: {
                    color: 'rgb(255,0,0)'
                  
                }
            },            
            data:${upperSpec?default("[]")},
            markLine : {
             precision: 4,
                data : [     
                    {type : 'average', name : 'UpperSpec Value', itemStyle:{normal:{color:'#dc143c'}}}
                ]
            }

        },
        {
            name:'lower',
            type:'line',
          itemStyle: {
                normal: {
                    color: 'rgb(255,0,0)'
                }
            },     
            data:${lowerSpec?default("[]")},
            markLine : {
                data : [     
                    {type : 'average', precision: 4, name : 'LowerSpec Value', itemStyle:{normal:{color:'#dc143c'}}}
                ]
            }
        },
        {
            name:'upperCl',
            type:'line',
          itemStyle: {
                normal: {
                    color: 'rgb(255,255,0)',
                    lineStyle: {       
                        width: 1
                    }
                }
            },
            data:${upperCl?default("[]")}
        },
        {
            name:'lowerCl',
             type:'line',
          itemStyle: {
                normal: {
                    color: 'rgb(255,255,0)',
                    lineStyle: {       
                        width: 1
                    }
                }
            },
            data:${lowerCl?default("[]")}

        },
        {
            name:'target',
            type:'line',
          itemStyle: {
                normal: {
                    color: 'rgb(0,0,0)',
                    lineStyle: {       
                        width: 1
                    }
                }
            },               
            data:${targetData?default("[]")}
        },
        {
            name:'Value',
            type:'line',
          itemStyle: {
                normal: {
                    color: 'rgb(0,128,0)',
                    lineStyle: {       
                        width: 1
                    }
                }
            },               
            data:${measureValue?default("[]")}
        }
       
    ]
};
       
                // 为echarts对象加载数据
                myChart.setOption(option);
            }
        );

加载中
0
涛声依旧4210

貌似是版本的问题,把源代码放到E-Charts官网例子上可以运行成功。。

返回顶部
顶部