echarts 修改legend圖例的顏色

  • legend的顏色是在option裏面直接定義的color數組,有幾個圖例就在color裏面寫幾個顏色值。
var option = {

 color:'#657DE9',

 tooltip: {
     trigger: "axis",
     axisPointer: {
         // 座標軸指示器,座標軸觸發有效
         type: "shadow" // 默認爲直線,可選爲:'line' | 'shadow'
     }
 },

 grid: {
     left: '3%',
     right: '4%',
     bottom: '3%',
     containLabel: true
 },

 legend: {
     borderColor:'#657DE9',
     textStyle: {
         color: '#657DE9',
     },
     data: ["線下投注的設備必須和上次登陸的設備一致(帳號)"]
 },
 }