option = { tooltip:{ trigger: 'axis' //鼠標懸浮提示 }, xAxis: { axisLabel:{ color:"#6f6f6f" //改變X軸坐標值顏色 }, axisLine:{ lineStyle:{ color:"#cfcfcf" //改變x軸線顏色 } }, axisTick:{ lineStyle:{ color:"#cfcfcf" //改變x軸線上的刻度顏色 } }, type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { axisLabel:{ color:"#6f6f6f" }, axisLine:{ lineStyle:{ color:"#cfcfcf" } }, axisTick:{ lineStyle:{ color:"#cfcfcf" } }, type: 'value' }, visualMap:{ orient:"horizontal", //圖例橫向展示,vertical縱向展示 itemSymbol:"circle", show:true, //展示圖例 top:0, //圖例位置 right:10, //圖例位置 textGap:10, //圖例文字距離 itemGap:20, //圖例之間距離 itemWidth:12, //圖例圖形寬度 itemHeight:12, pieces:[ {min:0,max:1100,label:"平均值之下",color:"blue",symbol:"emptyCircle"}, //設置范圍區域,label是圖例的名稱,symbol圖例的形狀 {min:1100,label:"平均值之上",color:"red",symbol:"emptyCircle"} ] }, series: [{ smooth:true, //折線圖展示有弧度 symbol:"circle", markLine:{ //平均線設置 silent:true, //true 去掉鼠標懸浮該線上的動畫 symbol:"none", //該線無樣式 label:{ show:false //該線上的值去掉 }, lineStyle:{ //設置該線樣式 normal:{ type:"solid", color:"#666666" } }, data:[{ yAxis:1100, //線的值 name:"target" }] }, data: [820, 932, 901, 934, 1290, 1330, 802], type: 'line' }] };

