User Tools

Site Tools


chartkick

This is an old revision of the document!


Some rando's options.

The library hash gets passed through Chartkick to chart.js.

def model_helper(data)
  line_chart(
    data,
    title: 'Chart title',
    ## Axes
    min: 10, # default 0 if no non-zero points
    max: 100,
    xtitle: 'Time',
    ytitle: 'Lolz',
 
    ## CSS
    id: 'lolchart',
 
    ## Appearance
    height: '500px',
    colors: COLORS,
    points: false,
 
    # Key
    legend: :bottom,
 
    ## No idea why these have to be in a hash:
    library: {
      spanGaps: true,
      lineTension: 0.5, # Values between 0 and 1-ish seem to do something
      curve: true, # false = straight line segments
    }
  )
end
chartkick.1619268953.txt.gz · Last modified: 2021/04/24 12:55 by slack