成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

js圖表控件:highcharts的應用(三)

    線形圖

站在用戶的角度思考問題,與客戶深入溝通,找到尼瀘西網(wǎng)站設計與尼瀘西網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設計與互聯(lián)網(wǎng)技術結合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:成都網(wǎng)站設計、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、主機域名、雅安服務器托管、企業(yè)郵箱。業(yè)務覆蓋尼瀘西地區(qū)。

    前臺代碼:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Line.aspx.cs" Inherits="hhh.Line" %>

<!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 runat="server">
    <title></title>
   
    <script src="Scripts/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var chart;
            $(document).ready(function () {
                chart = new Highcharts.Chart({
                    chart: {
                        renderTo: 'container',
                        type: 'line'
                    },
                    title: {
                        text: '測試數(shù)據(jù)'
                    },
                    xAxis: {
                        categories: [<%=str %>]
                    },
                    yAxis: {
                        title: {
                            text: '單位/萬元'
                        }
                    },
                    tooltip: {
                        formatter: function () {
                            return '<b>' + this.series.name + '</b><br/>' +
                    this.x + ': ' + this.y + '萬元'+'<br/>所占百分比:'+changeTwoDecimal_f((this.y/<%=allcount %>)*100)+'%';
                        }
                    },
                    plotOptions: {
                        line: {
                            dataLabels: {
                                enabled: true
                            },
                            enableMouseTracking: true
                        }
                    },
                    series: [{
                        name:'測試數(shù)據(jù)',
                        data: [<%=strdata %>]
                    }]
                });
            });
            changeTwoDecimal_f = function (floatvar) {
                var f_x = parseFloat(floatvar);
                if (isNaN(f_x)) {
                    alert('function:changeTwoDecimal->parameter error');
                    return false;
                }
                var f_x = Math.round(floatvar * 100) / 100;
                var s_x = f_x.toString();
                var pos_decimal = s_x.indexOf('.');
                if (pos_decimal < 0) {
                    pos_decimal = s_x.length;
                    s_x += '.';
                }
                while (s_x.length <= pos_decimal + 2) {
                    s_x += '0';
                }
                return s_x;
            }
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <script src="Scripts/highcharts.js" type="text/javascript"></script>
        <script src="Scripts/exporting.js" type="text/javascript"></script>
    <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
    </div>
    </form>
</body>
</html>

     后臺代碼:

     public string str = "";//文本
        public string strdata = "";//數(shù)據(jù)
        public double allcount = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadData();
        }
        protected void LoadData()
        {
            XmlDocument myDoc = new XmlDocument();
            myDoc.Load(Server.MapPath("DB_51aspx.xml"));

            XmlNode xn = myDoc.SelectSingleNode("//VoteInfo[ID='2']");//讀取數(shù)據(jù)源

            XmlNodeList xnl = xn.SelectNodes("Item");

            double AllCount = 0;//總數(shù)

            for (int i = 0; i < xnl.Count; i++)
            {
                AllCount += Convert.ToSingle(xnl.Item(i).SelectSingleNode("Count").InnerText);
            }
            allcount = AllCount;
            for (int i = 0; i < xnl.Count; i++)
            {
                XmlNode xn0 = xnl.Item(i);
                strdata += xn0.SelectSingleNode("Count").InnerText+ ",";
                str += "\'" + xn0.SelectSingleNode("Title").InnerText + "\'" + ",";
            }
            strdata = strdata.Remove(strdata.Length-1,1);
            str = str.Remove(str.Length-1,1);
        }

      效果圖展示:

      

js圖表控件:highcharts的應用(三)

 

網(wǎng)頁名稱:js圖表控件:highcharts的應用(三)
文章起源:http://jinyejixie.com/article0/iehjio.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設、靜態(tài)網(wǎng)站、外貿(mào)網(wǎng)站建設外貿(mào)建站、建站公司網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設
和静县| 镇远县| 汝南县| 慈溪市| 平舆县| 绥宁县| 修水县| 沽源县| 绥阳县| 富裕县| 台东市| 全椒县| 工布江达县| 余江县| 定陶县| 醴陵市| 新邵县| 新邵县| 乳山市| 兴化市| 浮梁县| 麻城市| 海口市| 汝阳县| 汝阳县| 磴口县| 云林县| 工布江达县| 西林县| 缙云县| 高台县| 内乡县| 馆陶县| 合江县| 清流县| 山丹县| 尉氏县| 双江| 宁德市| 昭通市| 平罗县|