2023-01-31 17:10:07 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
json.array!(@statistics) do |s|
|
|
|
|
json.extract! s, :id, :es_type_key, :label, :table, :ca
|
|
|
|
json.additional_fields s.statistic_fields do |f|
|
|
|
|
json.extract! f, :key, :label, :data_type
|
|
|
|
end
|
|
|
|
json.types s.statistic_types do |t|
|
|
|
|
json.extract! t, :id, :key, :label, :graph, :simple
|
2016-09-06 16:53:04 +02:00
|
|
|
json.custom_aggregations t.statistic_custom_aggregations do |c|
|
|
|
|
json.extract! c, :id, :field
|
|
|
|
end
|
2016-03-23 18:39:41 +01:00
|
|
|
json.subtypes t.statistic_sub_types do |st|
|
|
|
|
json.extract! st, :id, :key, :label
|
|
|
|
end
|
|
|
|
end
|
2023-01-31 17:10:07 +01:00
|
|
|
if s.statistic_graph
|
|
|
|
json.graph do
|
|
|
|
json.chart_type s.statistic_graph.chart_type
|
|
|
|
json.limit s.statistic_graph.limit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|