Closed roberthuttinger closed 8 years ago
The default is based on the domain of the data (or 0
by default for column charts). It only gets set to an explicit value once it is customized. Do you just want it to be 0
on the default data or for any data that is pasted in?
0 default for any new data that is created. that should be the default. It looks like it is 30 now (calculated)
For any data, or just the initial data?
Any new data with no calculation. If the range were 800-1000 the base would still be zero The user could then change it, but zero should be the default
To do this, you'll want to modify the behavior of the compute_scale_domain
helper function, found here.
you could change this (line 75)
if (!scaleObj.domain || !scaleObj.custom) {
if (opts.nice) {
_domain = niced;
} else {
_domain = extent;
}
defaultMin = true;
defaultMax = true;
} else {
to
if (!scaleObj.domain || !scaleObj.custom) {
if (opts.nice) {
_domain = [0, d3.max(niced)];
} else {
_domain = [0, d3.max(extent)];
}
defaultMin = true;
defaultMax = true;
} else {
though you may need something a bit fancier for negative numbers (eg sorting)
Awesome! I noticed that section but the syntax escaped me, and still wasnt sure after testing.
Bug was present, fixed and now works perfectly! thanks!
Tried explicitly setting defaults to zero but it looks like there is a check to return '' on zero. Setting the default to zero allows the zero to be displayed, but the binding is done on the fly so there is no external trigger for updating.
Im sure this is a simple issue, any idea where I can set the min == 0 in main.js?