Home > Back-end >  I put the ajax interface all comments, why series data showed on the chart
I put the ajax interface all comments, why series data showed on the chart

Time:11-21

<script type="text/javascript">
//var search;
//function serializeForm () {
//var formSerializeJson=wy$.com mon (' # formSearch). SerializeJson ();
//delete formSerializeJson. FormSerialize;
//var formSerializeJsonStr=JSON. Stringify (formSerializeJson);
//$(' # formSearch.) children (' input [type="hidden"] [name="formSerialize]]" '). The val (formSerializeJsonStr);
//}

Var chart1=echarts. Init (document. GetElementById (' divChart1 '));
Var option1={
Title: {
Text: 'order quantity statistics,
Left: 'center'
},
Tooltip: {
The trigger: 'item',
The formatter: '{a} & lt; Br/& gt; {b}, {c} ({d} %) '
},
Legend: {
Received: 'vertical',
Left: 'right',
Data: [' doctor a ', 'the doctor 2', 'the doctor 3', 'four doctors',' the doctor five]
},
Series: [
{
Type: 'pie',
The radius: '55%',
Center: [' 50% ', '60%'],
Data: [
{value: 335, name: 'the doctor a'},
{value: 310, name: 'doctor 2},
{value: 234, name: 'the doctor three'},
{value: 135, name: 'four doctors'},
{value: 148, name: 'doctor five'}
],
Emphasis: {
ItemStyle: {
ShadowBlur: 10,
ShadowOffsetX: 0,
ShadowColor: 'rgba (0, 0, 0, 0.5)'
}
}
}
]
};
Chart1. SetOption (option1)

//function getDataAndDrawChart () {
//$. Ajax ({
//url: '& lt; %=basePath % & gt;/admin/workload statistics/get - chart - data. The action ',
//the type: "POST",
//contentType: 'application/json,
//data: $(' # formSearch.) children (' input [type="hidden"] [name="formSerialize]]" '). The val (),
//success: function (resultState) {
//if (resultState) {
//if (resultState stateCode==200) {
//option1. Legend. Data=https://bbs.csdn.net/topics/resultState.data.legendData;
////option1. XAxis. Data=https://bbs.csdn.net/topics/resultState.data.xAxisData;
//option1. Series=[];
//for (var I=0; i //var item=resultState. Data. The series [I];
//var seriesItem={
//name: item name,
//type: 'pie',
//data: the item data
//}
//option1. Series. Push (seriesItem);
//}
////chart1. SetOption (option1, true);
//} else if (resultState stateCode==500) {
//wy $. The UI (). ShowAlert ({message: "system error"});
//} else {
//if (resultState. MSG & amp; & ResultState MSG! {
="")//wy $. The UI (). ShowAlert ({message: resultState. MSG});
//}
//}
//} else {
//wy $. The UI (). ShowAlert ({message: "system error"});
//}
//}
//});
//}

//$(function () {
//$(' select [name="reportStatus"] "). The select2 (} {minimumResultsForSearch: - 1);
//$(' select [name="deptCode"] "). The select2 ({allowClear: true});
//$(' select [name="userId"] "). The select2 ({allowClear: true});
//$('. Input - group. The date "). The datepicker ({
//autoclose: true,
//language: 'useful - CN,
//the format: '- dd yyyy - mm'
//});
//var currentColumns=[
//{data: 'the deptName, name:' dept. Dept_name},
//{data: 'examinationType, name:' mo. Examination_type},
//{data: 'patientName, name:' p.p atient_name '},
//{data: 'billAt, name:' a.c reated_at '},
//{data: 'doctorName, name:' u.f ull_name '}
//];
//serializeForm ();
//var table=wy $. UI (.) ({dataTable tableOptions: {columns: currentColumns, ordering: false, ajax: {url: '& lt; %=basePath % & gt;/admin/workload statistics/list. The action '}}});

//search=function () {
//table. The draw ();
//};
//$(' # btnSearch). Click (function () {
//serializeForm ();
//the search ();
//getDataAndDrawChart ();
//});

//getDataAndDrawChart ()
//});
</script>

  • Related