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

When axis labels are aligned left, space reserveSpace option is no longer respected. #5286

Open
eggers opened this Issue May 4, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@eggers

eggers commented May 4, 2016

Expected behaviour

Labels should take the same space whether align: "left" or align: "center" is used

Actual behaviour

When labels are aligned left (xAxis labels on a bar chart), space is no longer reserved for the labels.

Live demo of the issue

http://jsfiddle.net/w315zkaf/

Steps to reproduce the behaviour

Modify the sample bar chart, just addinging: labels: {align: 'left'} to the xAxis options.

Affected browser(s)

@eggers

This comment has been minimized.

Show comment
Hide comment
@eggers

eggers May 4, 2016

My jsfiddle sample wasn't added: http://jsfiddle.net/w315zkaf/

eggers commented May 4, 2016

My jsfiddle sample wasn't added: http://jsfiddle.net/w315zkaf/

@SpacePrez

This comment has been minimized.

Show comment
Hide comment
@SpacePrez

SpacePrez Oct 7, 2016

I'm also experiencing this same issue. HighCharts StackBar has serious bugs with labels due to the x-axis being on the left side.

SpacePrez commented Oct 7, 2016

I'm also experiencing this same issue. HighCharts StackBar has serious bugs with labels due to the x-axis being on the left side.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Oct 19, 2016

Collaborator

The rationale is that Highcharts assumes you want to put the labels inside, like this: http://jsfiddle.net/highcharts/w315zkaf/2/ .

That looks good on a value axis, not so good on a category axis with a stacked bar.

We need to modify the reserveSpace option. Currently it can be set to false to ignore the space of the label, but it should also be possible to set it to true to force the axis to reserve space, regardless of alignment. Then the default value should be null, which will be the current behaviour, a best guess based on alignment.

Related source code.

Collaborator

TorsteinHonsi commented Oct 19, 2016

The rationale is that Highcharts assumes you want to put the labels inside, like this: http://jsfiddle.net/highcharts/w315zkaf/2/ .

That looks good on a value axis, not so good on a category axis with a stacked bar.

We need to modify the reserveSpace option. Currently it can be set to false to ignore the space of the label, but it should also be possible to set it to true to force the axis to reserve space, regardless of alignment. Then the default value should be null, which will be the current behaviour, a best guess based on alignment.

Related source code.

@Izothep

This comment has been minimized.

Show comment
Hide comment
@Izothep

Izothep commented Oct 18, 2017

+1

TorsteinHonsi added a commit that referenced this issue Dec 14, 2017

Added feature, `xAxis.labels.reserveSpace` option only worked when se…
…tting it to false, could not be set to true to force reserved space. See #5286.
@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Dec 14, 2017

Collaborator

It's fixed now, but allowing the reserveSpace option to be set to true explicitly. See the fix applied at http://jsfiddle.net/highcharts/w315zkaf/5/.

This will be part of v6.0.4, shipping within a few days.

Collaborator

TorsteinHonsi commented Dec 14, 2017

It's fixed now, but allowing the reserveSpace option to be set to true explicitly. See the fix applied at http://jsfiddle.net/highcharts/w315zkaf/5/.

This will be part of v6.0.4, shipping within a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment