123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <!--框架必需start-->
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
- <link href="/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" id="skin" prePath="/qui/"/>
- <link rel="stylesheet" type="text/css" id="customSkin"/>
- <!--框架必需end-->
- <script src="/nwyj/scripts/qui/libs/thirdparty/highcharts/js/highcharts.js"></script>
- <script>
- var categories;
- var title;
- var series;
- function initgird() {
- alert(series);
- alert(categories);
- $('#container').highcharts({
- chart: {
- type: 'column'
- },
- title: {
- text: '营养含量'
- },
- xAxis: {
- categories: eval('('+categories+')')
- },
- yAxis: {
- min: 0,
- title: {
- text: '营养含量'
- },
- stackLabels: {
- enabled: true,
- style: {
- fontWeight: 'bold',
- color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
- }
- }
- },
- legend: {
- align: 'right',
- x: -70,
- verticalAlign: 'top',
- y: 20,
- floating: true,
- backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
- borderColor: '#CCC',
- borderWidth: 1,
- shadow: false
- },
- tooltip: {
- formatter: function() {
- return '<b>'+ this.x +'</b><br/>'+
- this.series.name +': '+ this.y +'<br/>'+
- '总量: '+ this.point.stackTotal;
- }
- },
- plotOptions: {
- column: {
- stacking: 'normal',
- dataLabels: {
- enabled: true,
- color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
- }
-
-
-
- }
- },
- series: eval('('+series+')')
- });
- };
-
- $(function () {
- var urls = "/nwyj/ws/PlanHuiZong/ContingencyPlanHuiZong/getAllSum";
- //var urls = "/nwyj/ws/rcbaobiao/RcBbService/getHighChart";
- $.ajax({
- url : urls,
- type : 'post',
- params:{deptID:'11'},
- timeout : 15000,
- async : false,
- dataType : 'json',
- success : function(data) {
- //alert(JSON.stringify(data));
- // alert(typeof data);
- var sss=data.beanList;
- alert(typeof sss);
- var ssss=JSON.stringify(sss);
- var s1=ssss.replace("\"{normal: {label:{show: true, position: insideRight}}}\"", "{normal: {label:{show: true, position: \"insideRight\"}}}");
- alert(s1);
- var s2=eval('('+ s1+')');
- alert(JSON.stringify(s2));
-
- series = data.series;
- categories=data.categories;
- initgird();
- },
- error : function(e) {
- $.messager.alert('查询失败!', '访问服务失败!', 'error');
- }
- });
- });
-
- </script>
- </head>
- <body>
- <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
-
- </body>
- </html>
|