You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "yousoph (via GitHub)" <gi...@apache.org> on 2023/06/23 05:52:33 UTC

[GitHub] [superset] yousoph opened a new issue, #24495: Show Cell Bars does not work on the Percentage Metrics in Table Chart

yousoph opened a new issue, #24495:
URL: https://github.com/apache/superset/issues/24495

   The Cell Bars option was not shown correctly in the Percentage Metrics column.
   
   #### How to reproduce the bug
   
   1. Create a Table chart.
   2. Add a column into the Dimensions, Metrics, and Percentage Metrics fields.
   3. Go to the Customize tab and enable the CELL BARS option.
   Alternatively, on the CUSTOMIZE COLUMNS field, ensure that the SHOW CELL BARS option is enabled for the column.
   
   ### Expected results
   
   The Cell Bars visual cue will be shown in the Percentage Metrics column.
   
   ### Actual results
   
   No Cell Bars visual cue is shown on the Percentage Metrics column.
   
   #### Screenshots
   
   ![image](https://github.com/apache/superset/assets/10627051/a14232b0-7f86-44ed-9460-2fcee229b996)
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Chrome
   - superset version: `master`
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active:
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Show Cell Bars does not work on the Percentage Metrics in Table Chart [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina closed issue #24495: Show Cell Bars does not work on the Percentage Metrics in Table Chart
URL: https://github.com/apache/superset/issues/24495


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Show Cell Bars does not work on the Percentage Metrics in Table Chart [superset]

Posted by "SA-Ark (via GitHub)" <gi...@apache.org>.
SA-Ark commented on issue #24495:
URL: https://github.com/apache/superset/issues/24495#issuecomment-1757784774

   The issue here is that the “isMetric” key for percentage metric is coming up as False from the columns when it is being imported from props. 
   ![image](https://github.com/apache/superset/assets/90512504/4ca6069a-ac0f-4d4c-bde7-15fe3c106581)
   
   
   As we follow the data into the line where we are creating “const valueRange”, we can see that we are calling the getValueRange function only when either “isMetric” is True or “isRawRecords” is true.  “isRawRecords” is false for both, and “isMetric” is only true for regular metrics and not percentage metrics. So the "getValueRange" function is not even being called for percentage metrics which is why it is not calculated for these metrics.
   
   ![image](https://github.com/apache/superset/assets/90512504/6600007e-5974-4cc9-a36e-e6abb3a1e0ce)
   
   
   When we follow the data further, we can see in the “<StyledCell>” component where we are returning the Cell Bars we have a condition of “valueRange” to not be null in order to display the cell bars. We can verify with console.logs that the valueRange is never calculated in the case of percentage metrics and it is null. This is why the cell bars are not showing up for only the percentage metrics because the css class for it is not being added since “valueRange” is null.
   
   ![image](https://github.com/apache/superset/assets/90512504/b941ad70-718b-4c08-8e3c-81e70a774bc9)
   
   
   Proposed solution:
   
   A solution that fixed the cell bars for me is adding a separate `key[0] == “%”` in the conditional where we are checking `(isMetric || isRawRecords)` while creating the `const “valueRange”` variable. This ensures none of the other code is messed with and the cell bars still show up.
   
   ![image](https://github.com/apache/superset/assets/90512504/0df46241-b789-41bc-9f3e-42da97e222ab)
   
   Alternatively, we can also make the isMetric variable true from the file where the percentage metric props are being created, but I am not sure if that might break other parts of the code, so this seemed to be the least intrusive way to fix it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org