For uniform binning (fixed bin size), there are two different ways to give the input:
1. number of bins (the current option only)
2. bin width
Label may needs to be changed as well.
To have a choice of the number of bins or bin width, two radio buttons and one text box are added. By default, the number of bins is selected. When the radio button is selected, a new value either number of bins or bin width should be entered and validated. Then the histogram will be updated accordingly. Since no data range information is available before sending the request, the bin width can not be validated correction. Thus, an exception is thrown if the bin width is large than the data range.
Based on the modified requirements, the UI is
- Add two radio buttons and two input text boxes next to the two radio buttons, one of which is number of bins and the other is bin width.
- Add two input text boxes below the two set radio/text boxes. One of which is for min and the other is max
After several discussions and iterations, we added the following:
- For single column histogram, since the data min/max is stored in the column variable array, they can be used to pre-fill the min and max.
- The bin width is calculated based on the number of bins and min and max and then the bin width is pre-filled.
- The bin width is recalculated each time when number of bins or min or max changes.
- When number of bin is selected, the bin width text box is disabled, when the bin width is selected, number of bins text box is disabled