12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%
- String path = request.getContextPath();
- %>
- <!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="<%=path%>/libs/js/jquery.js"></script>
- <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
- <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
- <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/"/>
- <link rel="stylesheet" type="text/css" id="customSkin"/>
- <!--框架必需end-->
- <script src="<%=path%>/libs/thirdparty/highcharts/js/highcharts.js"></script>
- <script>
- $(function () {
- $('#container').highcharts({
- chart: {
- type: 'column'
- },
- title: {
- text: '营养含量'
- },
- xAxis: {
- 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: [{
- name: '维生素A',
- data: [5, 3, 4, 7, 2]
- }, {
- name: '维生素B',
- data: [2, 2, 3, 2, 1]
- }, {
- name: '维生素C',
- data: [3, 4, 4, 2, 5]
- }]
- });
- });
-
- </script>
- </head>
- <body>
- <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
-
- </body>
- </html>
|