123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <!DOCTYPE html>
- <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
- <head>
- <th:block th:include="include :: header('图表')" />
- </head>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInDown">
- <div class="row">
- <div class="col-sm-5">
- <div class="jumbotron">
- <h1>Peity图表</h1>
- <p>是一个内嵌数据图形可视化的图表库</p>
- <p><a href="http://benpickles.github.io/peity/" target="_blank" class="btn btn-primary btn-lg" role="button">了解 Peity</a>
- </p>
- </div>
- </div>
- <div class="col-sm-7">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>饼状图 <small>自定义颜色</small></h5>
- <div class="ibox-tools">
- <a class="close-link">
- <i class="fa fa-times"></i>
- </a>
- </div>
- </div>
- <div>
- <table class="table table-bordered white-bg">
- <thead>
- <tr>
- <th>图表</th>
- <th>代码</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <span class="pie">1/5</span>
- </td>
- <td>
- <code><span class="pie">1/5</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="pie">226/360</span>
- </td>
- <td>
- <code><span class="pie">226/360</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="pie">0.52/1.561</span>
- </td>
- <td>
- <code><span class="pie">0.52/1.561</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="pie">1,4</span>
- </td>
- <td>
- <code><span class="pie">1,4</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="pie">226,134</span>
- </td>
- <td>
- <code><span class="pie">226,134</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="pie">0.52,1.041</span>
- </td>
- <td>
- <code><span class="pie">0.52,1.041</span></code>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>线性图</h5>
- <div class="ibox-tools">
- <a class="close-link">
- <i class="fa fa-times"></i>
- </a>
- </div>
- </div>
- <div>
- <table class="table table-bordered white-bg">
- <thead>
- <tr>
- <th>图表</th>
- <th>代码</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <span data-diameter="40" class="updating-chart">5,3,9,6,5,9,7,3,5,2,5,3,9,6,5,9,7,3,5,2</span>
- </td>
- <td>
- <code><span class="line">5,3,9,6,5,9,7,3,5,2</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="line">5,3,9,6,5,9,7,3,5,2</span>
- </td>
- <td>
- <code><span class="line">5,3,9,6,5,9,7,3,5,2</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="line">5,3,2,-1,-3,-2,2,3,5,2</span>
- </td>
- <td>
- <code><span class="line">5,3,2,-1,-3,-2,2,3,5,2</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="line">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span>
- </td>
- <td>
- <code><span class="line">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="bar">5,3,9,6,5,9,7,3,5,2</span>
- </td>
- <td>
- <code><span class="bar">5,3,9,6,5,9,7,3,5,2</span></code>
- </td>
- </tr>
- <tr>
- <td>
- <span class="bar">5,3,2,-1,-3,-2,2,3,5,2</span>
- </td>
- <td>
- <code><span class="bar">5,3,2,-1,-3,-2,2,3,5,2</span></code>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- <th:block th:include="include :: footer" />
- <th:block th:include="include :: peity-js" />
- <script type="text/javascript">
- $(function() {
- $("span.pie").peity("pie", {
- fill: ['#1ab394', '#d7d7d7', '#ffffff']
- })
-
- $(".line").peity("line",{
- fill: '#1ab394',
- stroke:'#169c81',
- })
-
- $(".bar").peity("bar", {
- fill: ["#1ab394", "#d7d7d7"]
- })
-
- $(".bar_dashboard").peity("bar", {
- fill: ["#1ab394", "#d7d7d7"],
- width:100
- })
-
- var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
-
- setInterval(function() {
- var random = Math.round(Math.random() * 10)
- var values = updatingChart.text().split(",")
- values.shift()
- values.push(random)
-
- updatingChart
- .text(values.join(","))
- .change()
- }, 1000);
-
- });
- </script>
- </body>
- </html>
|