zoukankan      html  css  js  c++  java
  • jquery.peity.js简介

    jQuery简单图表peity.js

    [javascript] 
    1. <html xmlns="http://www.w3.org/1999/xhtml">  
    2. <head>  
    3.     <title>无标题页</title>  
    4.     <script type="text/javascript" src="jQuery.js"></script>  
    5.     <script type="text/javascript" src="jquery.peity.js"></script>  
    6.     <script type="text/javascript">  
    7.         jQuery(function(){  
    8.             $(".bar-colours-1").peity("bar", {  
    9.               colours: ["red""green""blue"], 100,height:100  
    10.             })  
    11.             $(".bar-colours-2").peity("bar", {  
    12.               colours: function(value) {  
    13.                 return value > 0 ? "green" : "red"  
    14.               }, 100,height:100  
    15.             })  
    16.             $(".bar-colours-3").peity("bar", {  
    17.               colours: function(_, i, all) {  
    18.                 var g = parseInt((i / all.length) * 255)  
    19.                 return "rgb(255, " + g + ", 0)"  
    20.               }, 100,height:100  
    21.             })  
    22.             $(".pie-colours-1").peity("pie", {  
    23.               colours: ["cyan""magenta""yellow""black"],diameter:100  
    24.             })  
    25.             $(".pie-colours-2").peity("pie", {  
    26.               colours: function(_, i, all) {  
    27.                 var g = parseInt((i / all.length) * 255)  
    28.                 return "rgb(255, " + g + ", 0)"  
    29.               },diameter:100  
    30.             })  
    31.              
    32.              
    33.             var updatingChart = $(".updating-chart").peity("line", {  150,height:50})  
    34.             setInterval(function() {  
    35.               var random = Math.round(Math.random() * 10)  
    36.               var values = updatingChart.text().split(",")  
    37.               values.shift()  
    38.               values.push(random)  
    39.               updatingChart  
    40.                 .text(values.join(","))  
    41.                 .change()  
    42.             }, 1000)  
    43.         })  
    44.     </script>  
    45. </head>  
    46. <body>  
    47.     <span class="bar-colours-1">5,3,9,6,5,9,7,3,5,2</span>  
    48.     <span class="bar-colours-2">5,3,2,-1,-3,-2,2,3,5,2</span>  
    49.     <span class="bar-colours-3">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span>  
    50.     <br />  
    51.     <span class="pie-colours-1">4,7,6,5</span>  
    52.     <span class="pie-colours-2">5,3,9,6,5</span>  
    53.     <br />  
    54.     <span class="updating-chart">5,3,9,6,5,9,7,3,5,2,5,3,9,6,5,9,7,3,5,2</span>  
    55. </body>  
    56. </html>  
  • 相关阅读:
    Debian/Ubuntu/Raspbian 时间同步
    linux 安裝mitmproxy
    Raspbian Lite Guide GUI 树莓派安装桌面
    SSH连接 提示 ssh_exchange_identification: Connection closed by remote host
    Navicat15 永久激活版教程
    docker企业级镜像仓库Harbor管理
    centos7.4安装docker
    Linux系统硬件时间12小时制和24小时制表示设置
    windows server 2012 R2系统安装部署SQLserver2016企业版(转)
    细说show slave status参数详解
  • 原文地址:https://www.cnblogs.com/ada-zheng/p/3760923.html
Copyright © 2011-2022 走看看