-
-
Save knewter/4741498 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$ -> | |
$.get '/lol/get_data', (data) -> | |
load_chart = new Highcharts.Chart | |
chart: | |
renderTo: 'graph' | |
defaultSeriesType: 'line' | |
title: | |
text: 'Per Diem' | |
xAxis: | |
title: 'Time' | |
type: 'datetime' | |
labels: | |
formatter: -> | |
this.value | |
yAxis: | |
title: | |
text: 'Dollars' | |
plotOptions: | |
area: | |
marker: | |
enabled: false | |
symbol: 'circle' | |
radius: 2 | |
states: | |
hover: | |
enabled: true | |
series: [ | |
{ | |
name: 'Per Diem' | |
data: data | |
} | |
] |
This file contains hidden or 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
class LolController < ApplicationController | |
def get_data | |
@plutus_data = [] | |
@amounts = current_user.per_diem_account.amounts.each do |amount| | |
@plutus_data << [amount.transaction.created_at.strftime('%Y, %m, %d').html_safe, amount.amount] | |
end | |
render json: @plutus_data | |
end | |
end |
This file contains hidden or 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
Ignore me.... |
This file contains hidden or 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
#graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment