diff --git a/app/components/time_series_component.rb b/app/components/time_series_component.rb index 2bb42e805..506aff55c 100644 --- a/app/components/time_series_component.rb +++ b/app/components/time_series_component.rb @@ -18,7 +18,7 @@ class TimeSeriesComponent < ApplicationComponent def chart_height if x_axis != "date" - dataframe[x_axis].size * 30 + dataframe[x_axis]&.size.to_i * 30 end end diff --git a/app/components/time_series_component/time_series_component.html.erb b/app/components/time_series_component/time_series_component.html.erb index 2c4848be9..2bd2b2a23 100644 --- a/app/components/time_series_component/time_series_component.html.erb +++ b/app/components/time_series_component/time_series_component.html.erb @@ -6,7 +6,9 @@ <% end %> -<% if mode == :chart && x_axis.present? %> +<% if dataframe.empty? %> +

No results found. Try modifying your search or expanding your time range.

+<% elsif mode == :chart && x_axis.present? %>