-
Notifications
You must be signed in to change notification settings - Fork 12k
Scale expansion if min === max will only occur after ticks.beginAtZero is handled #1586
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
Conversation
|
To explain what my ideal behaviour would be I need to explain two configuration parameters that I would like to see. With lack of a better word for it, call them a 'minimum end value' and a 'minimum start value'. If the data is outside those boundaries, the current behaviour of scaling would occor normally. But if you've specified a minimum end-value of 1.0 and the data would jump between 0.09 and 0.11, you would still see it at ~ 10% of the scale. If a value changes very little, the chart is now 'zooming in' to show those small variations in great detail. This limits the information you can get out of it. With minimum ''start' and 'end'-values you can set, people can specify that the graph should show at least a scale of X to Y even if the variation is very limited. For the case with all values of '0', I would like them drawn at the (top) or bottom of the graph, depending on wether the minimum start or end value is > or < then 0. I hope I am making a little sense here. (edited for clarity) |
|
For a use-case where these parameters would make sense, consider a graph showing the traffic on an ethernet interface. If the interface is mostly idle, this would mean the chart would 'zoom in' and show very heavy variations of what would be just a few kilobytes worth of pings and arp requests. With a minimum end value, a user can force the scale to go at least to 10.000.000, (10Mbit) forcing all of those values at the bottom of the graph, where you would expect them. (Or in the middle if you want to represent incoming traffic and outgoing traffic as positive and negative values) With whitespace around the graph to give some context. |
|
@stephanarts I think I understand what you're looking for. You'd like options such as the following for each linear axis. ticks: {
// Number [optional] - suggested minimum for scale. scale.min = Math.min(data.min, options.ticks.min);
suggestedMin: 0,
// Number [optional] - forced maximum for scale. scale.max = Math.max(data.max, options.ticks.max)
suggestedMax: 1,
} |
|
Indeed :) |
|
Interesting. So instead of showing up as -1 and 1, it would use the suggestedMin and Max? |
|
Yup, suggested min/max could be used at any time. I propose |
|
@stephanarts I prototyped out a first version of Is it alright if the scale max ends up higher than |
|
I think that's not a problem. It is to help get a good first impression of what kind of value you are looking at. |
|
ok, great. I'll get my changes pushed up and included in this PR |
…stant-data Scale expansion if min === max will only occur after ticks.beginAtZero is handled
Replaces #1581 which was opened to the wrong branch.
@stephanarts What would your ideal behaviour be when all values are 0?