ECharts 經常會修改到的一些樣式配置


1.坐標軸:

 1 axisLine:{              //坐標軸軸線相關設置。
 2   show:true,        //是否顯示坐標軸軸線。
 3   lineStyle:{
 4     width:10           //坐標軸線線寬。 
 5     color:#333        //顏色。
 6     color:{
 7       colorStops:[{
 8         offset:0,color:'red',     //漸變的顏色
 9         offset:1,color:'bule'
10       }],
11     shadowColor:'red'     //陰影的顏色
12     shadowBlur:10     //陰影的寬度
13     }
14   }       
15 }
16  
17 axisLabel:{          //坐標軸刻度標簽的相關設置(坐標字體)
18     show:true       //是否顯示
19     rotate:45       //旋轉的角度從 -90 度到 90 度。
20     margin:25       //刻度標簽與軸線之間的距離。
21     color:#ffff       //字體顏色.
22     fontStyle:normal  italic  oblique //文字的風格。
23     fontWeight:20   //文字的粗細。
24     fontSize:18    //文字的大小。
25     shadowColor:18  //文字塊的背景陰影長度。
26 }

 

2.標題:

 1 "title": {
 2   "text": '全國機電產品出口總值',    //標題
 3    subtext: '機電產品',         //副標題
 4   "top": '85%',
 5   "left": '28%',
 6   "textStyle": {            //標題的文字樣式
 7     "fontSize": 16,
 8     "color": "#444",
 9     "text-align": "center",
10     "margin-top":"20px"
11   }
12 },

 

 
 

3.數據類型顯示(圖例):

legend:{
  x: 'right',
  icon:'pin',                 //形狀 ('circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow')
  data: ['6月份','7月份'],
  fontSize:18 
  left:20%    //位置設置可以(center ,  right)
  padding      //它們之間的距離
}

 

 

 
 
 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM