Skip to content

Conversation

@simonbrunel
Copy link
Member

Legend and title layout items must be updated when changing chart options:

var chart = new Chart(ctx, {
  options: {
    legend: {
      position: 'top'
    }
  }
};

chart.options.legend.position = 'left';
chart.update(); // <-- broken layout

@simonbrunel simonbrunel added this to the Version 2.6 milestone Apr 27, 2017
@simonbrunel simonbrunel requested a review from etimberg April 27, 2017 10:02
},

/**
* Sets (or updates) options on the given `item`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of completeness, should we add JSDoc comments for the parameters here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR but also changed a bit the configure behavior: only update item properties if there is an option value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@simonbrunel simonbrunel force-pushed the fix/legend_title_config_update branch from dbc5a42 to 346db9c Compare April 27, 2017 16:31
@etimberg etimberg merged commit f0c6b3f into chartjs:master Apr 29, 2017
@simonbrunel simonbrunel deleted the fix/legend_title_config_update branch May 7, 2017 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants