123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>sd</title>
- <script type="text/javascript">
- $(function(){
- if ($("#qyid").val() > 0) {
- var chartADiv = $("#chartB");
- $("#chartDiv_L").attr("style", "width:" + chartADiv.width() + "px");
- $("#chartDiv_L").attr("style", "height:" + (chartADiv.height() - 7) + "px");
- jQuery.ajax({
- type : "get",
- url : "getHkClientNhsjTjt.htm",
- data : {"qyid" : $("#qyid").val()},
- dataType : "json",
- async : true,
- success : function(data) {
- nhsj(data, "chartDiv_L");
- }
- });
- }
- });
- function nhsj(data, id) {
- var chart = new Highcharts.chart(id, {
- chart: {
- zoomType: 'xy',
- backgroundColor : 'transparent',
- spacingLeft : 0,
- spacingBottom : 0,
- },
- title: {
- text: ''
- },
- xAxis: [{
- categories: data.h,
- crosshair: true
- }],
- yAxis: [{ // Primary yAxis
- labels: {
- format: '{value}',
- style: {
- color: "#3a8ecf"
- }
- },
- title: {
- text: '水量(t)',
- style: {
- color: "#3a8ecf"
- }
- }
- }, { // Secondary yAxis
- title: {
- text: '电量(kw*h)',
- style: {
- color: "#f6bd0f"
- }
- },
- labels: {
- format: '{value}',
- style: {
- color: "#f6bd0f"
- }
- },
- opposite: true,
- allowDecimals: false,
- gridLineColor: "#142c4c"
- }],
- tooltip: {
- shared: true
- },
- colors: ["#3a8ecf", "#f6bd0f"],
- credits: {
- enabled: false
- },
- legend: {
- enabled : false,
- layout: 'vertical',
- align: 'left',
- x: 60,
- verticalAlign: 'top',
- y: 20,
- floating: true,
- backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
- },
- series: [{
- name: '电量',
- type: 'column',
- yAxis: 1,
- data: data.dl,
- tooltip: {
- valueSuffix: ' kw*h'
- }
- }, {
- name: '水量',
- type: 'column',
- data: data.sl,
- tooltip: {
- valueSuffix: ' t'
- }
- }]
- });
- }
- </script>
- </head>
- <body>
- <input type="hidden" id="qyid" value="$!qyid"/>
- <div>
- <div id="chartDiv_L"></div>
- </div>
- </body>
- </html>
|