Reputation: 35
I'm getting an error when I try to use morris.js in my Ruby on Rails project.
Uncaught TypeError: Cannot read property 'length' of undefined
This is my file
= content_tag :div, "", id: "weights_chart", data: {weights: @weights}
:javascript
new Morris.Line({
element: 'weights_chart',
data: $('#weights_chart').data('weights'),
xkey: 'created_at',
ykey: ['data'],
labels: ['Weight']
});
Upvotes: 0
Views: 66