Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var columnChart = function(viz,idleData,opData,titleText,xScaleType){
  2.      viz.yAxis().tickFormat(function (d) { return d + " hrs";});
  3.         viz.data([opData,idleData])
  4.             .width(document.body.getBoundingClientRect().width*0.5).height(300)
  5.             .y(function (d,i)
  6.                 {return d[1];})
  7.             .x(function (d,i)
  8.                 {return d[0];})
  9.             .xScale(xScaleType)
  10.             .padding(0.1);
  11.         var theme = vizuly.theme.column_bar(viz)
  12.             .skin(vizuly.skin.COLUMNBAR_PRETECKT);
  13.         var viz_title = viz.selection()
  14.             .select("svg")
  15.             .append("text")
  16.             .attr("class", "title")
  17.             .attr("x", viz.width() / 2)
  18.             .attr("y", 20).attr("text-anchor", "middle")
  19.             .style("fill", theme.skin().labelColor)
  20.             .style("font-weight",300)
  21.             .text("IDLE TIMES: "+titleText);
  22.         viz.layout("STACKED").update();
  23.         viz.update();
  24.     }
  25. //Here's where the plotting function is called for the 3 different data sets
  26. columnChart(vizDay,idleByDay,opByDay,"DAILY IDLE SUMMARY", d3.time.scale());
  27. columnChart(vizSixHour,idleBySixHour,opBySixHour,"6-HOUR IDLE SUMMARY", d3.time.scale());
  28. columnChart(vizHour,idleByHour,opByHour,"IDLING BY TIME OF DAY", d3.scale.ordinal());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement