$(document).ready -> bugdata = [ ["Regression test" , 15 , 25 , 30] ["Informal code reviews" , 20 , 25 , 35] ["Unit test" , 15 , 30 , 50] ["New function (component) test" , 20 , 30 , 35] ["Integration test" , 25 , 35 , 40] ["Low-volume beta test (< 10 users)" , 25 , 35 , 40] ["Informal design reviews" , 25 , 35 , 40] ["Personal desk checking of code" , 20 , 40 , 60] ["System test" , 25 , 40 , 55] ["Formal design inspections" , 45 , 55 , 65] ["Formal code inspections" , 45 , 60 , 70] ["Modeling or prototyping" , 35 , 65 , 80] ["High-volume beta test (> 1000 users)" , 60 , 75 , 85] ] bar_graph = ([item[1], i + 1, item[3]] for item, i in bugdata) bar_ticks = ([i + 1, item[0]] for item, i in bugdata) median_points = ([item[2], i + 1] for item, i in bugdata) $.plot "#bug_chart", [{ data: bar_graph color: "#8e1d08" bars: show: true barWidth: 0 horizontal: true }, { data: median_points, points: show: true color: "#8e1d08" } ], yaxis: # lazy transform: (v) -> -v ticks: bar_ticks tickLength: 0 position: "right" xaxis: min: 10 max: 109 grid: borderWidth: 0