peity.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('图表')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="wrapper wrapper-content animated fadeInDown">
  8. <div class="row">
  9. <div class="col-sm-5">
  10. <div class="jumbotron">
  11. <h1>Peity图表</h1>
  12. <p>是一个内嵌数据图形可视化的图表库</p>
  13. <p><a href="http://benpickles.github.io/peity/" target="_blank" class="btn btn-primary btn-lg" role="button">了解 Peity</a>
  14. </p>
  15. </div>
  16. </div>
  17. <div class="col-sm-7">
  18. <div class="ibox float-e-margins">
  19. <div class="ibox-title">
  20. <h5>饼状图 <small>自定义颜色</small></h5>
  21. <div class="ibox-tools">
  22. <a class="close-link">
  23. <i class="fa fa-times"></i>
  24. </a>
  25. </div>
  26. </div>
  27. <div>
  28. <table class="table table-bordered white-bg">
  29. <thead>
  30. <tr>
  31. <th>图表</th>
  32. <th>代码</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. <tr>
  37. <td>
  38. <span class="pie">1/5</span>
  39. </td>
  40. <td>
  41. <code>&lt;span class="pie"&gt;1/5&lt;/span&gt;</code>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td>
  46. <span class="pie">226/360</span>
  47. </td>
  48. <td>
  49. <code>&lt;span class="pie"&gt;226/360&lt;/span&gt;</code>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td>
  54. <span class="pie">0.52/1.561</span>
  55. </td>
  56. <td>
  57. <code>&lt;span class="pie"&gt;0.52/1.561&lt;/span&gt;</code>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td>
  62. <span class="pie">1,4</span>
  63. </td>
  64. <td>
  65. <code>&lt;span class="pie"&gt;1,4&lt;/span&gt;</code>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td>
  70. <span class="pie">226,134</span>
  71. </td>
  72. <td>
  73. <code>&lt;span class="pie"&gt;226,134&lt;/span&gt;</code>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td>
  78. <span class="pie">0.52,1.041</span>
  79. </td>
  80. <td>
  81. <code>&lt;span class="pie"&gt;0.52,1.041&lt;/span&gt;</code>
  82. </td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="row">
  91. <div class="col-sm-12">
  92. <div class="ibox float-e-margins">
  93. <div class="ibox-title">
  94. <h5>线性图</h5>
  95. <div class="ibox-tools">
  96. <a class="close-link">
  97. <i class="fa fa-times"></i>
  98. </a>
  99. </div>
  100. </div>
  101. <div>
  102. <table class="table table-bordered white-bg">
  103. <thead>
  104. <tr>
  105. <th>图表</th>
  106. <th>代码</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <tr>
  111. <td>
  112. <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>
  113. </td>
  114. <td>
  115. <code>&lt;span class="line"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td>
  120. <span class="line">5,3,9,6,5,9,7,3,5,2</span>
  121. </td>
  122. <td>
  123. <code>&lt;span class="line"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code>
  124. </td>
  125. </tr>
  126. <tr>
  127. <td>
  128. <span class="line">5,3,2,-1,-3,-2,2,3,5,2</span>
  129. </td>
  130. <td>
  131. <code>&lt;span class="line"&gt;5,3,2,-1,-3,-2,2,3,5,2&lt;/span&gt;</code>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td>
  136. <span class="line">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span>
  137. </td>
  138. <td>
  139. <code>&lt;span class="line"&gt;0,-3,-6,-4,-5,-4,-7,-3,-5,-2&lt;/span&gt;</code>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td>
  144. <span class="bar">5,3,9,6,5,9,7,3,5,2</span>
  145. </td>
  146. <td>
  147. <code>&lt;span class="bar"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td>
  152. <span class="bar">5,3,2,-1,-3,-2,2,3,5,2</span>
  153. </td>
  154. <td>
  155. <code>&lt;span class="bar"&gt;5,3,2,-1,-3,-2,2,3,5,2&lt;/span&gt;</code>
  156. </td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. <th:block th:include="include :: footer" />
  166. <th:block th:include="include :: peity-js" />
  167. <script type="text/javascript">
  168. $(function() {
  169. $("span.pie").peity("pie", {
  170. fill: ['#1ab394', '#d7d7d7', '#ffffff']
  171. })
  172. $(".line").peity("line",{
  173. fill: '#1ab394',
  174. stroke:'#169c81',
  175. })
  176. $(".bar").peity("bar", {
  177. fill: ["#1ab394", "#d7d7d7"]
  178. })
  179. $(".bar_dashboard").peity("bar", {
  180. fill: ["#1ab394", "#d7d7d7"],
  181. width:100
  182. })
  183. var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
  184. setInterval(function() {
  185. var random = Math.round(Math.random() * 10)
  186. var values = updatingChart.text().split(",")
  187. values.shift()
  188. values.push(random)
  189. updatingChart
  190. .text(values.join(","))
  191. .change()
  192. }, 1000);
  193. });
  194. </script>
  195. </body>
  196. </html>