peity-demo.js 764 B

123456789101112131415161718192021222324252627282930313233
  1. $(function() {
  2. $("span.pie").peity("pie", {
  3. fill: ['#1ab394', '#d7d7d7', '#ffffff']
  4. })
  5. $(".line").peity("line",{
  6. fill: '#1ab394',
  7. stroke:'#169c81',
  8. })
  9. $(".bar").peity("bar", {
  10. fill: ["#1ab394", "#d7d7d7"]
  11. })
  12. $(".bar_dashboard").peity("bar", {
  13. fill: ["#1ab394", "#d7d7d7"],
  14. width:100
  15. })
  16. var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
  17. setInterval(function() {
  18. var random = Math.round(Math.random() * 10)
  19. var values = updatingChart.text().split(",")
  20. values.shift()
  21. values.push(random)
  22. updatingChart
  23. .text(values.join(","))
  24. .change()
  25. }, 1000);
  26. });