Appendix: An Intuitive case
View more instance example, or use this demo or echarts single file to introduce as your template
Chart instantiation------------------//Srcipt tag introduced var mychart = Echarts.init (document.getElementById (' main '));// The transition---------------------mychart.showloading ({text: ' reading data in an effort ... ',//loading);//Ajax getting data ...... .//Ajax callbackmychart.hideloading ();//Chart using-------------------var option = {legend: { Legend configuration Padding:5,//legend padding, unit px, default upper and lower left and right padding of 5 itemgap:10, Legend the interval between each item, horizontally spaced when horizontal, and vertical when the layout is longitudinal interval data: [' iOS ', ' Android '}, tooltip: { Bubble tip configuration Trigger: ' Item ',//trigger type, default data trigger, Optional: ' Axis '}, Xaxis: [ Horizontal axis array in Cartesian coordinate system {type: ' category ',//axis type, horizontal axis by default, value axis Then refer to data: [' Jan ', ' Feb ', ' Mar ', ' Apr ', ' may ', ' June ', ' Jul ', ' yaxis ', ' Sep ', ' Oct ', ' Nov ', ' Dec '} ], YAxis: [ Vertical axis Array in Cartesian coordinate system {type: ' value ',//axis type, vertical axis default value axis, class axis reference Xaxis description BOUNDARYGAP: [0.1, 0.1],//axis blank policy at both ends, value in array represents percent splitnumber:4//value axis, segment number, default Think 5}], series: [{name: ' iOS ',//Series name type: ' Line ', chart types, line lines, scatter charts scatter, histogram bar, pie charts, radar data: [112, 23, 45, 56, 233, 343, 454, 89 , 343, 123, 123]}, {name: ' Android ',//Series name type: ' Line ', chart types, line lines, scatter charts scatter, histogram bar, pie charts, radar data: [45, 123, 145, 526, 233, 343, 44, 82 9, 123,]};mychart.setoption, (option), ...//Add some data------------------Option.legend.data.push (' win '); O Ption.series.push ({name: ' win ',//Series name type: ' Line ', Chart type, line chart lines, scatter chart ScattEr, histogram bar, pie chart, radar data: [233, 343, 454, 343, 123, 123, (+), mychart.setoption]}); (option); ...//Chart Empty-------------------mychart.clear ();//Chart Release-------------------Mychart.dispose ();
A visual example of the Echart website