Skip to content
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

Allow reset of y axis range to "auto" #1762

Open
pehrlich opened this issue Jul 12, 2016 · 3 comments
Open

Allow reset of y axis range to "auto" #1762

pehrlich opened this issue Jul 12, 2016 · 3 comments

Comments

@pehrlich
Copy link

Via the axis range api, the bounds of axis can be specified: http://c3js.org/samples/api_axis_range.html

However, there is no way to set the axis back to the default automatic value. Something like this would be nice:

    chart.axis.min({y: 'auto'});
@vereis
Copy link

vereis commented Jul 14, 2016

Does setting it to undefined work? I'm doing something similar though not using the API directly and it works for me.

@pehrlich
Copy link
Author

I tried that, without luck. Looks like this would result in having yMin set to undefined in c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {, but follow the logic beyond that didn't get me any further insight.

@nidu
Copy link

nidu commented Oct 11, 2016

Hi. I kinda could mimic range reset with following code. Maybe it can help somehow

// chart is this obtained from oninit callback
chart.config.axis_x_min = undefined
chart.config.axis_y_min = undefined
chart.config.axis_y2_min = undefined

chart.config.axis_x_max = undefined
chart.config.axis_y_max = undefined
chart.config.axis_y2_max = undefined

chart.redraw({withUpdateOrgXDomain: true, withUpdateOrgYDomain: true})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants