When operating echarts, the requirements require that the echarts xy axis be of the same color as the graphic.
Figure 1:
Figure 2:
Solution:
Code Show:
var MyChart1;
$ (function () {document.getElementById ("Begin1"). Flatpickr ();
document.getElementById ("End1"). Flatpickr ();
MyChart1 = Echarts.init (document.getElementById (' Mychart1 '));
Mychart1.showloading ({text: "The chart data is trying to load ..."}); Number of bidders for the top ten statistics var options1 = {title: {Tex T: ' Bidder's cumulative number of registrations ', X: ' Center '},//col
Or:colorarr, tooltip: {trigger: ' axis ', Axispointer: {//Axis indicator, axis trigger valid type: ' Shadow '//default is line, Optional: ' Lines ' |
' Shadow '},
Toolbox: { Show:true, x: ' 950 ',//download font display not full feat Ure: {//dataview: {show:false, readonly:false}, M
Agictype: {show:true, type: [' line ', ' Bar ']},//restore: {show:true}, Saveasimage: {show:true}}},// Legend: {//x: ' Left ',//data: [' bidding agent name ']// }, Grid: {//Left: ' 1% ',// Right: ' 10% ',//Bottom: ' 3% ',//Containlabel:tru
E y2:140}, Xaxis: { Type: ' CatEgory ', Name: ' Bidder ', data: ['], axislabel:{interval:0,//Transverse information display rotate:-30,// -30 degree angle tilt Display}, axisline:{line style:{color: ' #0087ED ', width:1,//here for highlighting plus
}},
YAxis: {type: ' value ', Name: ' Unit: Times ',
Splitline: {lineStyle: {//using shades of color
Color: [' #0087ED ']}
}, Nametextstyle: {color: [' #0087ED ']}, axisline:{linestyle:{C
Olor: ' #0087ED ', width:1,//here to highlight the addition of} }}, Series: [{Nam
E: ' Bidder name ', type: ' Bar ', stack: ' Number ',
Label: {normal: {show:true,
Position: ' Top '}, Data: ['], color:[' #0087ED '], item
Style: { Normal: {barborderradius:5,}
}, Barwidth:30,}]
};
Mychart1.setoption (OPTIONS1);
GetChartData1 ();
}); function GetChartData1 () {//Get the Options object of the chart var newOption1 = Mych
Art1.getoption ();
The parameter var StartDate = $ ("#begin1"). Val ();
var endDate = $ ("#end1"). Val ();
var type = $ ("#jylx-type1"). Val ();
if (Type==null | | type== "" | | type== "undefine") {type = "${type}";
} var Centercode = $ ("#jyzx-all1"). Val (); Number of bidders to register the top ten statistics $.ajax ({type: "POST", async: false,//synchronous execution URL: "Bidder!bmcsbar.do", data: {
Startdate:startdate, Enddate:enddate, Type:type,
Centercode:centercode}, DataType: "JSON",//return data in the form of JSON Success:function (data) {if (data) {NewOption1
. Xaxis[0].data = Data.category;
Newoption1.series[0].data = data.series;
Mychart1.hideloading ();
Mychart1.setoption (NewOption1); }}, Error:function (errormsg) {alert ("Chart request data failed!")
);
Mychart1.hideloading ();
}
});
}//Load column chart based on query criteria function ShowChart1 () {getChartData1 (); } </script>
Reprint Address: http://blog.csdn.net/wu920604/article/details/53422960