def resources_by_date(klass_name)
      klass       = klass_name.to_s.constantize
      created_ats = klass.order(:created_at).pluck(:created_at).compact
      steps       = date_range.step(date_steps).map(&:end_of_day)
      index       = 0
      counts      = created_ats.reduce(Hash.new(0)) do |counts, timestamp|
        cutoff = steps[index]

        # As long as timestamps have not exceeded the last date step
        if cutoff.present?
          if timestamp < cutoff
            counts[cutoff] += 1
          else
            index               += 1
            next_cutoff          = steps[index]
            counts[next_cutoff] += (counts[cutoff] + 1) if next_cutoff.present?
          end
        end

        counts
      end

      counts.values.to_s
    end
def resources_by_date(klass_name)
      klass       = klass_name.to_s.constantize
      created_ats = klass.order(:created_at).pluck(:created_at).compact
      steps       = date_range.step(date_steps).map(&:end_of_day)
      index       = 0
      counts      = created_ats.reduce(Hash.new(0)) do |counts, timestamp|
        cutoff = steps[index]

        # As long as timestamps have not exceeded the last date step
        if cutoff.present?
          if timestamp < cutoff
            counts[cutoff] += 1
          else
            index               += 1
            next_cutoff          = steps[index]
            counts[next_cutoff] += (counts[cutoff] + 1) if next_cutoff.present?
          end
        end

        counts
      end

      counts.values.to_s
    end
a string of the array of the count of (klass) objects
 along the date_range, on every displayed interval