Echarts---实现平滑的折线图

Echarts2.0版本javascript

正常咱们设置的折线图,通常都是线性的,在series中设置折线数据的时候,能够设置smooth:true 去设置当前的折线为平滑折线。java

 

option = {
        tooltip : {
            trigger: 'axis'
        },
        grid: {
            left: 30,
            right:20,
            top:30,
            bottom:30

        },
        legend: {
           /* y: 'bottom',*/
           x:"right",
            data:['黄岩区','路桥区','渡江区'],
            textStyle:{    //图例文字的样式
                color:'#194296',
                fontSize:12
            }
        },
        calculable : true,
        xAxis : [
            {
                type : 'category',
                axisLabel: {
                    color: "#194296"  //刻度线标签颜色
                },
                boundaryGap : false,
                data : ['0','4','8','12','16','20']
            }
        ],
        yAxis : [
            {
                type : 'value',
                splitLine:false,
                axisLabel: {
                    color: "#194296"  //刻度线标签颜色
                },

                /*data : ['0','20','40','60','80','100']*/
            }
        ],
        series : [
            {
                name:'黄岩区',
                type:'line',
                color:'#d5d073',
                smooth:true,//设置折线图平滑
                data:[20, 40, 70, 50, 40, 80]
            },
            {
                name:'路桥区',
                type:'line',
                smooth:true,//设置折线图平滑
                data:[24, 48, 65, 50, 46,  85]
            },
            {
                name:'渡江区',
                type:'line',
                smooth:true,//设置折线图平滑
                data:[30, 42, 56, 60, 50, 90]
            }
        ]
    };

效果图以下:code

 

symbol:'none', //这句就是去掉点的ip

相关文章
相关标签/搜索