1. 程式人生 > >echart的折線圖線條設定更細或者更粗

echart的折線圖線條設定更細或者更粗

option = {
    legend: {
        data:['高度(km)與氣溫(°C)變化關係']
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    tooltip : {
        trigger: 'axis',
        formatter: "Temperature : <br/>{b}km : {c}°C"
    },
    xAxis : [
        {
            type : 'value',
            axisLabel : {
                formatter: '{value} °C'
            }
        }
    ],
    yAxis : [
        {
            type : 'category',
            axisLine : {onZero: false},
            axisLabel : {
                formatter: '{value} km'
            },
            boundaryGap : false,
            data : ['0', '10', '20', '30', '40', '50', '60', '70', '80']
        }
    ],
    series : [
        {
            name:'高度(km)與氣溫(°C)變化關係',
            type:'line',
            itemStyle: {
                normal: {
                    lineStyle: {
                      width:0.1// 0.1的線條是非常細的了
                    }
                }
            },
            data:[15, -50, -56.5, -46.5, -22.1, -2.5, -27.7, -55.7, -76.5]
        }
    ]
};