%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/medipszd/www/bower_components/morris.js/spec/lib/grid/
Upload File :
Create Path :
Current File : //home/medipszd/www/bower_components/morris.js/spec/lib/grid/y_label_format_spec.coffee

describe 'Morris.Grid#yLabelFormat', ->

  it 'should use custom formatter for y labels', ->
    formatter = (label) ->
      flabel = parseFloat(label) / 1000
      "#{flabel.toFixed(1)}k"
    line = Morris.Line
      element: 'graph'
      data: [{x: 1, y: 1500}, {x: 2, y: 2500}]
      xkey: 'x'
      ykeys: ['y']
      labels: ['dontcare']
      preUnits: "$"
      yLabelFormat: formatter
    line.yLabelFormat(1500).should.equal "1.5k"

Zerion Mini Shell 1.0