tombenner / reports_kit

Beautiful, interactive charts and tables for Ruby on Rails
https://reportskit.co
MIT License
362 stars 31 forks source link

unable to load charts #49

Open smitakiran25 opened 5 years ago

smitakiran25 commented 5 years ago

I am using

versions

ruby -2.4.5 rails- 5.2 bootstrap sb-admin-2 postgresql

app/assets/javascripts/application.js

//= require jquery //= require jquery_ujs //= require turbolinks //= require reports_kit/application //= require bootstrap_sb_admin_base_v2 //= require font_awesome5 //= require all //= require cable //= require dataTables.bootstrap4.min //= require jquery.dataTables.min //= require jquery.easing.min //= require popper //= require bootstrap //= require Chart.bundle //= require chartkick //= require activestorage //= require_tree .

app/assets/stylesheets/application.css

= require bootstrap_sb_admin_base_v2 = require font-awesome = require font_awesome5_webfont = require dataTables.bootstrap4.min = require reports_kit/application = require_tree . *= require_self

config/reports_kit/reports/my_users.yml

   measure: user
   dimensions:
  - created_at

app/views/dashboard

config/routes.rb mount ReportsKit::Engine, at: '/'

chart is loading after refreshing, only download buttons are displaying and after refreshing the ui is also not coming correctly

report

after refreshing

reports1

kirantpatil commented 5 years ago

Please verify now, I have added "turbolinks:load" as below to file

vi ~/.rvm/gems/ruby-2.4.5/gems/reports_kit-0.7.1/app/assets/javascripts/reports_kit/lib/_init.js

window.ReportsKit = {};

//$(document).ready(function() {
var ready = function() {
  $('.reports_kit_report').each(function(index, el) {
    var el = $(el)
    var reportClass = el.data('report-class');
    new ReportsKit[reportClass]().render({ 'el': el });
  });
 }
//});

$(document).on('turbolinks:load', ready);
kirantpatil commented 5 years ago

@tombenner, could you please verify and release a new version with this fix.

Thanks.