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