-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option for BigNumber to not start y-axis at 0 #5552
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5552 +/- ##
==========================================
- Coverage 63.36% 63.36% -0.01%
==========================================
Files 351 351
Lines 22258 22259 +1
Branches 2470 2470
==========================================
Hits 14104 14104
- Misses 8139 8140 +1
Partials 15 15
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this. My only question is about the language as I think we may have a similar feature elsewhere and thus it would be great if this was consisent.
I believe we have a y-min/max setting for the nvd3 line chart, but I think a boolean is better here. In person we discussed actually preferring the option "start y-axis at 0" (rather than the negated version it is now), the issue is that we want the default to be In thinking about this more though, we could use the preferred "start y-axis at 0," and then check if the value |
@williaster controls have a But yes, the default should be to not be 0-bound since this is the previous behavior and much like a sparkline: we want to highlight how that big number is trending. |
@mistercrunch I tried setting the default to |
@kristw make sure to follow go vanilla from following a plain link from a chart that was save before the control existed. If you had loaded the chart prior to changing/setting the default, the value may have gotten materialized in the URL, and then stays when refreshing the page. |
@kristw from my understanding, this function https://github.com/apache/incubator-superset/blob/master/superset/assets/src/explore/store.js#L102 should be applying defaults to values that are missing. You may have to debug why that's not the case. |
@@ -1479,6 +1479,14 @@ export const controls = { | |||
description: t('Whether to display the trend line'), | |||
}, | |||
|
|||
do_not_start_y_axis_at_zero: { | |||
type: 'CheckboxControl', | |||
label: t('Do not start y-axis at 0'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use positive logic here. Instead of do_not_start_y_axis_at_zero
can we make it start_y_axis_at_zero
. Changing the name you can pull off the !
here
I feel like most users actually prefer the Y axis to be set to the min value so we can leave default
as false.
2d18b1e
to
0ec8664
Compare
Somehow after restarting machine the default value works. Must be glitch on my machine. Thanks @mistercrunch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add option to not start y-axis at 0 * Update language to positive. (cherry picked from commit aa14bac)
* Add option to not start y-axis at 0 * Update language to positive.
With the recent change to
BigNumber
, the BigNumber with trend line will start y-axis at 0 by default. However, this behavior may be not desirable in some situation, so this PR add an option to overwrite that and start y-axis at min value instead.@graceguo-supercat @williaster