Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart continues expand vertical when using filter_datetime #25

Open
hiroki-kaneko opened this issue Dec 22, 2017 · 5 comments
Open

Chart continues expand vertical when using filter_datetime #25

hiroki-kaneko opened this issue Dec 22, 2017 · 5 comments

Comments

@hiroki-kaneko
Copy link

hiroki-kaneko commented Dec 22, 2017

At first, Thank you for making wonderful tool.

I find a bug when I use filter datetime.
It looks inifinite loop happens in reports_kit.
You can see same phenomenon at this page below:

https://www.reportskit.co/examples/filter_datetime

This is my environment:

ruby 2.3.3-p222
Rails 5.1.4
bootstrap-sass 3.3.7
reports_kit latest

Thanks,
Hiro

@hiroki-kaneko hiroki-kaneko changed the title Table continues expand vertical when using filter_datetime Chart continues expand vertical when using filter_datetime Dec 22, 2017
@kirantpatil
Copy link

Yes, I also noticed it but forgot to inform it.

@hiroki-kaneko
Copy link
Author

Thank you for information. On the other hand, this chart hasn't problem:
https://www.reportskit.co/categories/interaction

Do you think that it is cause of using f.date_range or not?

@kirantpatil
Copy link

We faced same issue but resolved it putting div's around render_report as below

<div class= "row" >
 <div class="col-sm-6">
<%= render_report 'subscribers' %>
</div>
</div>

@kirantpatil
Copy link

@hiroki-kaneko were you able to resolve your issue ?

@hiroki-kaneko
Copy link
Author

hiroki-kaneko commented Jan 19, 2018

@kirantpatil Sorry for response is delay. I still stacked at this issue, But, I fixed this issue right now.
I enclosed row and column class with Bootstrap3. However, When I delete pull-right, It works very well!

<div class="row">
  <div id="content" class="col-sm-12">
    <%= render_report 'sales' do |report| %>
      <%= report.form do |f| %>
        <div class="pull-right"> <!-- I copyied ReportsKit's filter_datetime page but I deleted -->
          <%= f.date_range :created_at %>
        </div>
      <% end %>
    <% end %>
  </div>
</div>

YAML

measure:
  key: customer
  name: Revenue
  aggregation: todays_revenue
filters:
- created_at
contextual_filter:
- current_store
dimensions:
  - key: created_at
    granularity: day

and Model Class

  include ReportsKit::Model
  reports_kit do
    contextual_filter :current_store, -> (relation, context_params) {relation.where(store: context_params[:store])}
    aggregation :todays_revenue, [:sum, 'customers.charge']
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants