In ADS Pie Chart, a "group small values" option is offered. Do the same for VA Pie Chart as well.
Color legend selection: When the user selects an entry in the color legend that corresponds to a small value, then the chart will appear grayed out. This is acceptable behavior as there is no easy way to work around this due to the multiple chart cell scenario. For example a particular category may be a small value in one chart cell, but may be a large value in another chart cell. Thus we cannot remove the small value categories from the color legend.
Tooltip behavior: Hovering over the "Others" category, the tooltip should show the category as "Others". However when the user clicks View Data, the Summary tab should expand the category into the individual small value categories. The Underlying tab should contain all rows that corresponds to the same. The existing code logic should already handle this. Thus no code changes for this is expected.
|
171 KB
|
191 KB
|
122 KB
![]() |
355 KB
Implementation note: For pie chart only, not sunburst. Manipulate the in-memory data iterator to physically group the small values into one bucket, named "Others". An example: if the data iterator contains 10 data points, the result could contain only 6 data points if 5 of them are small values.
Note that if all values are below the small value threshold, then they will all get grouped into a single "Others" category.
Add a new section in the Options popup, between the "Show Empty Categories" and "Center Hole Size" sections:
Note that the small values settings is per worksheet and applies to all measures in a worksheet.
Note that if all values are below the small value threshold, then they will all get grouped into a single "Others" category.
Add a new section in the Options popup, between the "Show Empty Categories" and "Center Hole Size" sections:
Note that the small values settings is per worksheet and applies to all measures in a worksheet.
From sagarzond:
Nhi,
We have implemented code as below :
private void groupSmallValue() { //TODO remove hardcoding BIValueNode valueObj = _data.getValueObject(); if(valueObj != null) { Double total = valueObj.getValues().stream().mapToDouble(a -> Double.valueOf(Objects.toString(a, null))).reduce(0, (a, b) -> a + b); List values = valueObj.getValues(); List keys = valueObj.getKeys(); Iterator valueIterator = values.iterator(); Iterator keyIterator = keys.iterator(); Double otherValue = new Double(0); while(valueIterator.hasNext()) { Double value = (Double) valueIterator.next(); Object key = keyIterator.next(); if(((value * 100) / total ) < 30){ otherValue += value; valueIterator.remove(); keyIterator.remove(); } } if(otherValue != 0){ keys.add("Other"); values.add(otherValue); } if(_data instanceof BIChartDataImpl) { BIChartDataImpl dataImpl = ((BIChartDataImpl) _data); dataImpl.setComponentCount(values.size()); } } }
With this implementation having following questions :
From sagarzond:
Nhi,
We have implemented code as below :
private void groupSmallValue() { //TODO remove hardcoding BIValueNode valueObj = _data.getValueObject(); if(valueObj != null) { Double total = valueObj.getValues().stream().mapToDouble(a -> Double.valueOf(Objects.toString(a, null))).reduce(0, (a, b) -> a + b); List values = valueObj.getValues(); List keys = valueObj.getKeys(); Iterator valueIterator = values.iterator(); Iterator keyIterator = keys.iterator(); Double otherValue = new Double(0); while(valueIterator.hasNext()) { Double value = (Double) valueIterator.next(); Object key = keyIterator.next(); if(((value * 100) / total ) < 30){ otherValue += value; valueIterator.remove(); keyIterator.remove(); } } if(otherValue != 0){ keys.add("Other"); values.add(otherValue); } if(_data instanceof BIChartDataImpl) { BIChartDataImpl dataImpl = ((BIChartDataImpl) _data); dataImpl.setComponentCount(values.size()); } } }
With this implementation having following questions :
The above code changes are incorrect. The BIValueNode was not designed with modifications in mind. Thus modifying the object can have unknown consequences. Instead, you should construct a new object with a new keys and values list containing the modified values.
Also as pointed out by the screenshot attachment, the color legend will also need to be updated to add the "Others" category. We don't want to remove the small categories from the color map because in a multiple chart cell scenario, a category with small value in one chart cell may have a large value in another chart cell. The contents of the color legend is constructed in BIModelAccordionsHelper.buildDimensionColors(). There's a special scenario where a "Grand Total" entry is added to the color legend. Thus you want to add the "Others" category in a similar way.
This grouping of small values and adding "Others" to color legend should be done only if the right condition is met. Basically do this only if the "group small values" settings == TRUE, chart type == Pie chart, and there is exactly 1 dimension field in the Chart Properties deck. For the latter, you can use the BIModelAccordionsHelper.getAccordionDimensionFields() to check the number of dimension fields.
Note that I've updated the issue description regarding the color legend selection behavior and tooltip behavior.
The above code changes are incorrect. The BIValueNode was not designed with modifications in mind. Thus modifying the object can have unknown consequences. Instead, you should construct a new object with a new keys and values list containing the modified values.
Also as pointed out by the screenshot attachment, the color legend will also need to be updated to add the "Others" category. We don't want to remove the small categories from the color map because in a multiple chart cell scenario, a category with small value in one chart cell may have a large value in another chart cell. The contents of the color legend is constructed in BIModelAccordionsHelper.buildDimensionColors(). There's a special scenario where a "Grand Total" entry is added to the color legend. Thus you want to add the "Others" category in a similar way.
This grouping of small values and adding "Others" to color legend should be done only if the right condition is met. Basically do this only if the "group small values" settings == TRUE, chart type == Pie chart, and there is exactly 1 dimension field in the Chart Properties deck. For the latter, you can use the BIModelAccordionsHelper.getAccordionDimensionFields() to check the number of dimension fields.
Note that I've updated the issue description regarding the color legend selection behavior and tooltip behavior.
Nhi,
Having following questions :
Nhi,
Having following questions :
We cannot disable the View Data for "Others" because doing so will greatly reduce the value add of the feature to group small values.
When the user clicks View Data, the Summary tab should expand the category into the individual small value categories. The Underlying tab should contain all rows that corresponds to the same. Basically it should behave as if all of the individual small pie slices were selected.
Since the individual cell coordinates are needed for this functionality, then during the grouping logic you have to save the necessary info so that this is available later for calculating the individual cell coordinates. I don't remember on top of my head what info is required, so you'll have to analyze the existing VA code. Please don't study the ADS code as it is irrelevant in VA. The only reason the ADS functionality is mentioned is to show an example of the pie slice that contains the grouped values.
We cannot disable the View Data for "Others" because doing so will greatly reduce the value add of the feature to group small values.
When the user clicks View Data, the Summary tab should expand the category into the individual small value categories. The Underlying tab should contain all rows that corresponds to the same. Basically it should behave as if all of the individual small pie slices were selected.
Since the individual cell coordinates are needed for this functionality, then during the grouping logic you have to save the necessary info so that this is available later for calculating the individual cell coordinates. I don't remember on top of my head what info is required, so you'll have to analyze the existing VA code. Please don't study the ADS code as it is irrelevant in VA. The only reason the ADS functionality is mentioned is to show an example of the pie slice that contains the grouped values.
Nhi,
I tried to implement View data option by storing small values keys and used it while showing data inside view data -> Underlying. It worked but didnt think this will be better approach because existing code uses cell coordinate. So better approach will be like using cell coordinates of small values. I didn't find any way to find cell coordinate by its key.
Can you please direct me for better approach and how to implement it.
Nhi,
I tried to implement View data option by storing small values keys and used it while showing data inside view data -> Underlying. It worked but didnt think this will be better approach because existing code uses cell coordinate. So better approach will be like using cell coordinates of small values. I didn't find any way to find cell coordinate by its key.
Can you please direct me for better approach and how to implement it.
Code Review (SVN #55536):
Code Review (SVN #55536):
Functional Review:
Functional Review:
Behavior Change Required:
The slider under "Group Small Values" is too sensitive and not user friendly. Please make the following changes:
Behavior Change Required:
The slider under "Group Small Values" is too sensitive and not user friendly. Please make the following changes:
Nhi,
[Nhi]
Nhi,
[Nhi]
Nhi,
We have fixed with following issues :
Fixed with following functional comments :
Could you please help us to solve following issue :
In this case problem is like when we group small values data into other caordinate then all cell cordinate gets changed. But co-ordinate mapping does not get changed into PivotDataModel. How cell coordinate getting calculated in Pie Chart ? Can you please assist us to solve this problem.
Nhi,
We have fixed with following issues :
Fixed with following functional comments :
Could you please help us to solve following issue :
In this case problem is like when we group small values data into other caordinate then all cell cordinate gets changed. But co-ordinate mapping does not get changed into PivotDataModel. How cell coordinate getting calculated in Pie Chart ? Can you please assist us to solve this problem.
The required implementation is far more complex than we originally thought. The rendering of grouped small values is relatively simple. However the view data, keep only and exclude functionalities are much more complicated to correctly implement. Further, the current code changes also break Merged Measures (Single and Multiple Rings) when Group Small Values are enabled.
Please revert all changes made in this issue. We'll defer this feature to a later release.
The required implementation is far more complex than we originally thought. The rendering of grouped small values is relatively simple. However the view data, keep only and exclude functionalities are much more complicated to correctly implement. Further, the current code changes also break Merged Measures (Single and Multiple Rings) when Group Small Values are enabled.
Please revert all changes made in this issue. We'll defer this feature to a later release.
Issue #15333 |
Reopened |
Incomplete |
Completion |
No due date |
Fixed Build ADS_18.5 |
Time Estimate 50 hours |
Implementation note: For pie chart only, not sunburst. Manipulate the in-memory data iterator to physically group the small values into one bucket, named "Others". An example: if the data iterator contains 10 data points, the result could contain only 6 data points if 5 of them are small values.