Highchart图形报表

http://www.highcharts.com/demo/

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Chart-update.aspx.cs" Inherits="AngularJS.Chart_update" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Chart-update</title>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script src="https://code.highcharts.com/highcharts.js"></script>
    <script src="https://code.highcharts.com/highcharts-more.js"></script>
    <script src="https://code.highcharts.com/modules/exporting.js"></script>


</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="container"></div>
      <%--  <button id="plain">Plain</button>
        <button id="inverted">Inverted</button>
        <button id="polar">Polar</button>--%>
    </div>
    </form>
    <script>
        var chart = Highcharts.chart('container', {

            title: {
                text: 'Chart.update'
            },

            subtitle: {
                text: 'Plain'
            },

            xAxis: {
                categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
            },

            series: [{
                type: 'column',
                colorByPoint: true,
                data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
                showInLegend: false
            }]

        });


        //$('#plain').click(function () {
        //    chart.update({
        //        chart: {
        //            inverted: false,
        //            polar: false
        //        },
        //        subtitle: {
        //            text: 'Plain'
        //        }
        //    });
        //});

        //$('#inverted').click(function () {
        //    chart.update({
        //        chart: {
        //            inverted: true,
        //            polar: false
        //        },
        //        subtitle: {
        //            text: 'Inverted'
        //        }
        //    });
        //});

        //$('#polar').click(function () {
        //    chart.update({
        //        chart: {
        //            inverted: false,
        //            polar: true
        //        },
        //        subtitle: {
        //            text: 'Polar'
        //        }
        //    });
        //});

    </script>
</body>
</html>
//data可以直接绑定返回的数组
//如下所示
var item_subno = [];
var price = [];

var dataService = {
    ID: "ID", //查询-返回实体值.ds
    Args: {

    }
};
Service.Core.executeDataService(dataService, function(ret) {
    //console.log(ret); //F12打开开发者工具,在控制台中就可以查看
    //Common.Dialog.alertDetail(ret);
    if(ret.length > 0) {
       for(var i = 0; i < ret.length; i++) {
            item_subno.push(ret[i].item_subno);
            price.push(ret[i].price);
        }
    }
    
    var chart = Highcharts.chart('container', {
    
    title: {
        text: 'Chart.update'
    },

    subtitle: {
        text: 'Plain'
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    series: [{
        type: 'column',
        colorByPoint: true,
        data:price,//[29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
        showInLegend: false
    }]

});

});




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值