Skip to content

Commit

Permalink
Fix units formating for grouped charts
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Feb 20, 2017
1 parent f6021af commit 69dfff4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/report_formatter/c3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def build_document_header
unless mri.graph[:type] == 'Donut' || mri.graph[:type] == 'Pie'
mri.chart[:legend] = {:position => 'bottom'}
end
format, options = javascript_format(mri.graph[:columns][0], nil)

binding.pry
column = is_grouped_by_tag_category? ? mri.graph[:columns][0].split(/_+/)[0..-2].join('_') : mri.graph[:columns][0]
format, options = javascript_format(column, nil)
return unless format

axis_formatter = {:function => format, :options => options}
Expand Down Expand Up @@ -174,5 +177,9 @@ def build_performance_chart_pie(_maxcols, _divider)
mri.chart[:miq][:expand_tooltip] = true
super
end

def is_grouped_by_tag_category?
!!(mri.performance && mri.performance.fetch_path(:group_by_category))
end
end
end

0 comments on commit 69dfff4

Please sign in to comment.