Skip to content

Instantly share code, notes, and snippets.

@knewter
Forked from rclements/gist:4741481
Last active December 12, 2015 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knewter/4741498 to your computer and use it in GitHub Desktop.
Save knewter/4741498 to your computer and use it in GitHub Desktop.
$ ->
$.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
}
]
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
Ignore me....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment