Advertisement
Guest User

Untitled

a guest
May 30th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $(".bargraph").each(function(graphIdx,graphEl){
  2. var graph = $(graphEl);
  3. console.group("Graph: %o", graph);
  4.  
  5. var graphHeight = graph.height();
  6. console.info("height: %s", graphHeight);
  7.  
  8. var maxValue = parseInt(graph.find(".barNotches li").first().text());
  9. console.log("maxValue: %s", maxValue);
  10.  
  11. graph.find(".barColumnFill").each(function(columnIdx,columnEl){
  12. var column = $(columnEl);
  13. var barValue = 0;
  14. var barHeight = 0;
  15. console.group("column: %o", column);
  16.  
  17. barValue = column.data('barvalue');
  18. console.log("barValue: %s", barValue);
  19.  
  20. barHeight = (barValue/maxValue * 100) + "%";
  21. console.log("barHeight: %s", barHeight);
  22.  
  23. column.height(barHeight);
  24. console.groupEnd();
  25. });
  26.  
  27. console.groupEnd();
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement