Skip to content

Instantly share code, notes, and snippets.

@vicentereig
Last active December 10, 2015 12:19

Revisions

  1. vicentereig revised this gist Jan 2, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion chart_wrapper.coffee
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    $ = jQuery
    class GoogleChartWrapper
    @defaults = {}
    constructor: (@$el, options) ->
    constructor: (@$el, @options={}) ->
    $.extend true, @options, @defaults, @$el.data()
    @chart = new google.visualization.ChartWrapper options
    @chart.draw()
  2. vicentereig revised this gist Jan 2, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions chart_wrappers.coffee
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    $ = jQuery
    $ ->
    $('#vis-div').chartWrapper
    $('#iteration-visualization').chartWrapper
    chartType: 'ColumnChart'
    options:
    title: 'Iteration Contents Charts'
    isStacked: true
    colors: ['#DFE32D','#A8CFFF', '#FF9797']
    containerId: 'vis-div'
    containerId: 'iteration-visualization'
  3. vicentereig revised this gist Jan 2, 2013. 1 changed file with 8 additions and 7 deletions.
    15 changes: 8 additions & 7 deletions chart_wrappers.coffee
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,9 @@
    $ = jQuery
    $ -> $('#vis-div').chartWrapper
    chartType: 'ColumnChart'
    options:
    title: 'Iteration Contents Charts'
    isStacked: true
    colors: ['#DFE32D','#A8CFFF', '#FF9797']
    containerId: 'vis-div'
    $ ->
    $('#vis-div').chartWrapper
    chartType: 'ColumnChart'
    options:
    title: 'Iteration Contents Charts'
    isStacked: true
    colors: ['#DFE32D','#A8CFFF', '#FF9797']
    containerId: 'vis-div'
  4. vicentereig revised this gist Jan 2, 2013. 3 changed files with 23 additions and 1 deletion.
    14 changes: 14 additions & 0 deletions chart_wrapper.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    $ = jQuery
    class GoogleChartWrapper
    @defaults = {}
    constructor: (@$el, options) ->
    $.extend true, @options, @defaults, @$el.data()
    @chart = new google.visualization.ChartWrapper options
    @chart.draw()

    $.fn.chartWrapper = (options={}) ->
    @each ->
    $el = $(@)
    api = new GoogleChartWrapper($el, options)
    $el.data('GoogleChartWrapper', $el)

    8 changes: 8 additions & 0 deletions chart_wrappers.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    $ = jQuery
    $ -> $('#vis-div').chartWrapper
    chartType: 'ColumnChart'
    options:
    title: 'Iteration Contents Charts'
    isStacked: true
    colors: ['#DFE32D','#A8CFFF', '#FF9797']
    containerId: 'vis-div'
    2 changes: 1 addition & 1 deletion index.html.haml
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    #vis-div{data: {dataTable: @dataTable.to_json.html_safe}}
    #iteration-visualization{data: {dataTable: @dataTable.to_json.html_safe}}
  5. vicentereig created this gist Jan 2, 2013.
    1 change: 1 addition & 0 deletions index.html.haml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    #vis-div{data: {dataTable: @dataTable.to_json.html_safe}}