博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在.NET中使用highcharts实例代码
阅读量:6605 次
发布时间:2019-06-24

本文共 1456 字,大约阅读时间需要 4 分钟。

 
<%@ Page Language="C#" MasterPageFile="~/test/test.master" AutoEventWireup="true"
    CodeFile="highcharts.aspx.cs" Inherits="test_highcharts" Title="" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="http://yuxnet.blog.163.com/blog/../Com/js/jquery-1.6.4.min.js" type="text/javascript"></script>
    <script src="http://yuxnet.blog.163.com/blog/../Com/js/highstock/highstock.js" type="text/javascript"></script>
    <script src="http://yuxnet.blog.163.com/blog/../Com/js/highstock/modules/exporting.js" type="text/javascript"></script>
    <script type="text/javascript">
        var FundAGICode = '0025';
        $(function() {
            $.ajax({
                type: 'get',
                url: 'highcharts-data.aspx',
                data: { 'FundAGICode': FundAGICode },
                cache: false,
                success: function(result) {
                    //result = "([[1109116800000, 29.9], [1109203200000, 44.46]])";
                    var data = eval(result);
                    // Create the chart
                    window.chart = new Highcharts.StockChart({
                        chart: {
                            renderTo: 'container'
                        },
                        rangeSelector: {
                            selected: 1
                        },
                        title: {
                            text: '儲存淨值走勢圖'
                        },
                        series: [{
                            name: '净值',
                            data: data,
                            tooltip: {
                                valueDecimals: 2
                            }
}],
                            //隐藏右下角的highcharts.com
                            credits: {
                                href: '',
                                text: ''
                            },
                            //隐藏右上角的打印和导出图标
                            exporting: {
                                enabled: false
                            }
                        });
                    }
                });
            });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="container" style="height: 500px; min-width: 500px; width: 800px;">
    </div>
</asp:Content>

转载于:https://www.cnblogs.com/360net/p/3477008.html

你可能感兴趣的文章
HDU 3954 Level up(多颗线段树+lazy操作)
查看>>
hdu Stars(树状数组)
查看>>
jquery中ajax方法load get post与脚本文件如php脚本连接时,脚本怎样接受数据?
查看>>
PHP面向对象的进阶学习(抽像类、接口、final、类常量)
查看>>
三种数据库访问——Spring3.2 + Hibernate4.2
查看>>
datasg中的数据的存储结
查看>>
iOS 多线程 之 GCD(大中枢派发)(一)
查看>>
[记]SAF 中缓存服务的实现
查看>>
pstool 的使用方法
查看>>
Email - Boss's concerns
查看>>
余世维 - 有效沟通
查看>>
mysql用户与权限管理笔记
查看>>
a里面不能嵌套a
查看>>
Myeclipse中打开接口实现类的快捷键
查看>>
浅谈React数据流管理
查看>>
<20190516> 一次比较糟糕的售后维修体验(某硕主板)
查看>>
iOS网络篇2-http协议通信规则
查看>>
删除sql dump中的AUTO_INCREMENT
查看>>
使用JdbcTemplate和JdbcDaoSupport
查看>>
Ruby-GNOME2 1.2.0 发布,支持 GTK+ 3
查看>>