Created
May 4, 2012 01:02
-
-
Save Veejay/2590837 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render: (date_range, models) -> | |
# Grab data | |
data = _.sortBy (get_data date_range, models), (o) -> | |
parseInt o.id.split("-").join(""), 10 | |
# Scale | |
ratio = get_ratio @maxHeight, data | |
height = _.bind get_height, null, ratio | |
# Render | |
chart = d3.select(@el[0]) | |
list = chart.selectAll("li") | |
.data(data, (d) -> d.id) | |
list | |
.style("height", height) | |
.attr("class", get_class) | |
.select("span") | |
.text(get_value) | |
list.enter().append("li") | |
.attr("class", get_class) | |
.style("height", height) | |
.append("span") | |
.text(get_value) | |
list.exit() | |
.remove() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment