Skip to content

Instantly share code, notes, and snippets.

@tsyber1an
Created July 5, 2012 10:10
Show Gist options
  • Save tsyber1an/3052772 to your computer and use it in GitHub Desktop.
Save tsyber1an/3052772 to your computer and use it in GitHub Desktop.
nvd3 example
#stats{style: "height: 500px;"}
%svg
drawChart = (data) ->
nv.addGraph ->
chart = nv.models.multiBarChart()
chart.xAxis.tickFormat (d) ->
d3.format(",f") d
chart.yAxis.tickFormat (d) ->
d3.format("f") d
d3.select("#stats svg").datum(data).transition().duration(500).call chart
nv.utils.windowResize chart.update
chart
drawChart request_stats.datum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment