echart 加載圖標的同時加載某個主題

最近用echart作圖標時發現某個主題很對我胃口,因而我就搜索了一下加載的方法,本身總結了一下,以下:echarts

//獲得資源信息後繪chart的圖標spa

getEchart:function(id,legendData,xData,series){ip

var chart= echarts.init(document.getElementById(id),macatheme);資源

chart.setOption({get

   tooltip : {it

       trigger: 'axis'io

   },function

   legend: {搜索

       data:legendData,grid

       y : 'bottom',

       padding:0

   },

   grid: {x:'7%',y:'5%',x2:'5%',y2:'18%'},

   calculable : true,

   xAxis : [

       {

           type : 'category',

           boundaryGap : false,

           data : xData

       }

   ],

   yAxis : [

       {

           type : 'value'

       }

   ],

   series :series

});

}

在此以前記得將主題文件和echart的文件引入。

相關文章
相關標籤/搜索