<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script> <script src="/js/highcharts.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js" type="text/javascript"></script> <script src="/js/adapters/mootools-adapter.js" type="text/javascript"></script> <script src="/js/highcharts.js" type="text/javascript"></script>
//顯示統計圖 function ShowGraph(data) { var xname = []; var seriesData = []; var series5 = {}; series5["name"] = "5"; var tempdata = []; var project = $('#Project').find("option:selected").text(); var index = 0; for (var i in data) { if (project == "所有") { tempdata.push(parseFloat(data[i]["C5Per"])); xname[index++] = data[i]["Project"]; } else { if (project == data[i]["Project"]) { tempdata.push(parseFloat(data[i]["C5Per"])); xname[index++] = data[i]["Project"]; } } } series5["data"] = tempdata; seriesData.push(series5); var series4 = {}; series4["name"] = "4"; tempdata = []; for (var i in data) { if (project == "所有") { tempdata.push(parseFloat(data[i]["C4Per"])); } else { if (project == data[i]["Project"]) { tempdata.push(parseFloat(data[i]["C4Per"])); } } } series4["data"] = tempdata; seriesData.push(series4); var series3 = {}; series3["name"] = "3"; tempdata = []; for (var i in data) { if (project == "所有") { tempdata.push(parseFloat(data[i]["C3Per"])); } else { if (project == data[i]["Project"]) { tempdata.push(parseFloat(data[i]["C3Per"])); } } } series3["data"] = tempdata; seriesData.push(series3); var series2 = {}; series2["name"] = "2"; tempdata = []; for (var i in data) { if (project == "所有") { tempdata.push(parseFloat(data[i]["C2Per"])); } else { if (project == data[i]["Project"]) { tempdata.push(parseFloat(data[i]["C2Per"])); } } } series2["data"] = tempdata; seriesData.push(series2); var series1 = {}; series1["name"] = "1"; tempdata = []; for (var i in data) { if (project == "所有") { tempdata.push(parseFloat(data[i]["C1Per"])); } else { if (project == data[i]["Project"]) { tempdata.push(parseFloat(data[i]["C1Per"])); } } } series1["data"] = tempdata; seriesData.push(series1); $("#container").empty(); $('#container').highcharts({ colors: ['#a9d86e', '#ffb500', '#5eaee3', '#847eb6', '#e06292'], chart: { type: 'column', options3d: { enabled: true, alpha: 15, beta: 15, viewDistance: 25, depth: 40 } }, title: { text: '國民體質指標分析' }, xAxis: { categories: xname }, yAxis: { allowDecimals: false, min: 0, max: 100, title: { text: '比例' } }, tooltip: { headerFormat: '<b>{point.key}</b><br>', pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: 佔{point.y}%' }, plotOptions: { column: { stacking: 'normal', depth: 40 } }, series: seriesData }); }