<img src="http://files.jb51.net/file_images/article/201405/20140502140729.gif?20144214754" alt="jQuery 단순 차트 peity.js 사용법 example_jquery" ><br><div class="codetitle"> <span><a style="CURSOR: pointer" data="83774" class="copybut" id="copybut83774" onclick="doCopy('code83774')"><u>复主代码</u></a></span> 代码如下:</div> <div class="codebody" id="code83774"> <br><html xmlns="http:/ /www.w3.org/1999/xhtml"> <br><머리> <br><title>无标题页</title> <br><script type="text/javascript" src="jQuery.js"></script> <br><script type="text/javascript" src="jquery.peity.js"></script> <br><script type="text/javascript"> <br>jQuery(function(){ <br>$(".bar-colours-1").peity("bar", { <br>색상: ["red", "green", "blue"], 너비: 100, 높이:100 <br>}) <br>$(".bar-colours-2").peity("bar", { <br>colours: function(value) { <br>반환 값 > ; 0 ? "녹색" : "빨간색" <br>}, 너비: 100, 높이:100 <br>}) <br>$(".bar-colours-3").peity("bar", { <br>색상: function(_, i, all) { <br>var g = parseInt((i / all.length) * 255) <br>return "rgb(255, " g ", 0)" <br> },너비: 100,높이:100 <br>}) <br>$(".pie-colours-1").peity("pie", { <br>색상: ["청록색", "마젠타색", "노란색", "검은색"],직경:100 <br>}) <br>$(".pie-colours-2").peity("pie", { <br>색상: function(_, i, all) { <br>var g = parseInt((i / all.length) * 255) <br>return "rgb(255, " g ", 0)" <br>},diameter:100 <br>}) <br><br><br>var presentsChart = $(".updating-chart").peity("line", { width: 150,height:50}) <br>setInterval(function() { <br> var random = Math.round(Math.random() * 10) <br>var value = presentsChart.text().split(",") <br>values.shift() <br>values.push(random) <br>updatingChart <br>.text(values.join(",")) <br>.change() <br>}, 1000) <br>}) <br></script> <br></head> <br><본문> <br><span class="bar-colours-1">5,3,9,6,5,9,7,3,5,2</span> <br><span class="bar-colours-2">5,3,2,-1,-3,-2,2,3,5,2</span> <br><span class="bar-colours-3">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span> <br><br /> <br><span class="pie-colours-1">4,7,6,5</span> <br><span class="pie-colours-2">5,3,9,6,5</span> <br><br /> <br><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> <br></body> <br></html> <br> </div>