Created
March 21, 2012 15:15
-
-
Save stoplion/2148256 to your computer and use it in GitHub Desktop.
Promise interface to call HighCharts
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
thirty_days_of_apps = $.getJSON application_chart_url | |
thirty_days_of_apps.done (data) -> | |
draw_chart(data, 'application_chart', 'Job Applications in last 30 days', 'Applications', 'areaspline') | |
draw_number_of_apps(data) | |
thirty_days_of_apps.fail -> | |
console.log "You failed congrats!" | |
draw_number_of_apps = (data) -> | |
total_apps_last_seven_days =+ num[1] for num in data[-7..] | |
$('.total_apps_last_seven_days').html total_apps_last_seven_days |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment