Closed pjammer closed 8 years ago
The current version of this gem bundles Chart.js v1.0.2. It doesn't know about plugins; I imagine you could add a plugin by getting the asset pipeline to pick it up after Chart.js, but I haven't tried it.
The gem doesn't do anything to the x axis; you get whatever Chart.js gives you.
What sort of error are you seeing?
Using <%= line_chart @data, {width: 1000, generateLegend: true, scaleOverride: true} %>
chartjs-ror (2.2.0) lib/chartjs/axis_helpers.rb:27:in `each'
chartjs-ror (2.2.0) lib/chartjs/axis_helpers.rb:27:in `max'
chartjs-ror (2.2.0) lib/chartjs/axis_helpers.rb:27:in `ordinate_scale'
chartjs-ror (2.2.0) lib/chartjs/chart_helpers.rb:25:in `chart'
chartjs-ror (2.2.0) lib/chartjs/chart_helpers.rb:7:in `block (2 levels) in '
app/views/datastores/compare.html.erb:4:in `_app_views_datastores_compare_html_erb__3985059706827773447_70232126434220'
No error on scaleSteps: 2 example above anymore, i think i had a dodgy chartjs.scatter mucking up the assets dir. I got rid of it and this is the only error i am getting now, but i don't know what scaleOverride:true does anyways, just thought i'd report.
You didn't include the actual exception message so I'm not sure what the problem is. Could you post the message please?
However I suggest you leave out the scaleOverride: true
altogether. I originally put it in because I wanted the y-axis scale handled differently in my app (see nnnick/Chart.js#132) – but now I think this gem should be a simple wrapper around Chart.js, without any extra functionality.
Thought I'd ask this here, as i heard about a Chart.scatter plugin that scales an x-axis but I then came here to the README, since I'm using the gem.
i got an error adding
and
I'll dig more, but thought I'd ask this here.
Good work and good gem.