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

Removing title doesn't reflow legend #8014

Closed
pawelfus opened this Issue Mar 14, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@pawelfus
Contributor

pawelfus commented Mar 14, 2018

Expected behaviour

Legend above the plotting area

Actual behaviour

Legend overlaps plotting area

Live demo with steps to reproduce

http://jsfiddle.net/BlackLabel/m1ydcLx7/7/

Before:
screen shot 2018-03-14 at 15 35 12

Click on "remove title":
screen shot 2018-03-14 at 15 35 19

Details

In 6.0.4 we implemented anty-collision for legend, from changelog:

Highcharts now makes room for the legend in the layout if it has verticalAlign: 'top' with a horizontal legend. In existing charts using this layout, the layout of the legend and the plot area may be affected.

So it looks like init is correct, but title's change should also change chart's box.

@pawelfus

This comment has been minimized.

Contributor

pawelfus commented Mar 14, 2018

Workaround:
Snippet:

  chart.setTitle({
    text: null
  }, {
    text: null
  }, false);
  chart.isDirtyLegend = true; // workaround
  chart.redraw();

Demo: http://jsfiddle.net/BlackLabel/m1ydcLx7/16/

@pawelfus pawelfus added the Bug label Mar 14, 2018

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