Convert bar charts in Productivity Analytics to Proper Histograms
Problem to Solve
We are releasing Productivity Analytics in 12.3 without having the opportunity to bin the data in the bar charts in order to form proper histograms. It's currently difficult for a user to grasp the distribution without aggregations
Proposal
We discussed using https://github.com/ecomfe/echarts-stat in order to turn the bar charts into histograms, but it was decided to do the binning on the BE for performance reasons. We can use the gem with this binning behavior (https://www.rubydoc.info/gems/histogram/0.2.4.1, data.histogram(:fd)
or (bins, freqs) = data.histogram(30)
- it most probably has to be automatic, though, so the first option.
The labels we display can be either the intervals or the beginning/end of the interval
When we select a bar/multiple bars, the rest of the charts get filters for the array in days_to_merge[]
. What this means is that if we select the bar having (5,10] days, we should only filter the rest of the dash for MRs that have taken any time between 5 and 10.