<script type="text/javascript">
// var search;
// function serializeForm() {
// var formSerializeJson = wy$.common('#formSearch').serializeJson();
// delete formSerializeJson.formSerialize;
// var formSerializeJsonStr = JSON.stringify(formSerializeJson);
// $('#formSearch').children('input[type="hidden"][name="formSerialize"]').val(formSerializeJsonStr);
// }
var chart1 = echarts.init(document.getElementById('divChart1'));
var option1 = {
title: {
text: '開單量統計',
left: 'center'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'right',
data: ['醫生一', '醫生二', '醫生三', '醫生四', '醫生五']
},
series: [
{
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{value: 335, name: '醫生一'},
{value: 310, name: '醫生二'},
{value: 234, name: '醫生三'},
{value: 135, name: '醫生四'},
{value: 148, name: '醫生五'}
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
chart1.setOption(option1)
// function getDataAndDrawChart() {
// $.ajax({
// url: '<%=basePath%>/admin/workload-statistics/get-chart-data.action',
// type : 'POST',
// contentType: 'application/json',
// data: $('#formSearch').children('input[type="hidden"][name="formSerialize"]').val(),
// success: function (resultState) {
// if (resultState) {
// if (resultState.stateCode == 200) {
// option1.legend.data = resultState.data.legendData;
// // option1.xAxis.data = resultState.data.xAxisData;
// option1.series = [];
// for (var i = 0; i < resultState.data.series.length; i++) {
// var item = resultState.data.series[i];
// var seriesItem = {
// name: item.name,
// type: 'pie',
// data: item.data
// }
// option1.series.push(seriesItem);
// }
// // chart1.setOption(option1, true);
// } else if (resultState.stateCode == 500) {
// wy$.ui().showAlert({message: "系統錯誤"});
// } else {
// if (resultState.msg && resultState.msg != ""){
// wy$.ui().showAlert({message: resultState.msg});
// }
// }
// } else {
// wy$.ui().showAlert({message: "系統錯誤"});
// }
// }
// });
// }
// $(function () {
// $('select[name="reportStatus"]').select2({ minimumResultsForSearch: -1 });
// $('select[name="deptCode"]').select2({ allowClear: true });
// $('select[name="userId"]').select2({ allowClear: true });
// $('.input-group.date').datepicker({
// autoclose: true,
// language: 'zh-CN',
// format: 'yyyy-mm-dd'
// });
// var currentColumns = [
// { data: 'deptName', name: 'dept.dept_name' },
// { data: 'examinationType', name: 'mo.examination_type' },
// { data: 'patientName', name: 'p.patient_name' },
// { data: 'billAt', name: 'a.created_at' },
// { data: 'doctorName', name: 'u.full_name' }
// ];
// serializeForm();
// var table = wy$.ui().dataTable({tableOptions: {columns: currentColumns, ordering: false, ajax: {url: '<%=basePath%>/admin/workload-statistics/list.action'}}});
// search = function() {
// table.draw();
// };
// $('#btnSearch').click(function () {
// serializeForm();
// search();
// getDataAndDrawChart();
// });
// getDataAndDrawChart()
// });
</script>
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/225627.html
標籤:Web 開發
上一篇:水帖
下一篇:提示java.lang.Exception: java.lang.StringIndexOutOfBoundsException 求幫助
