Michal S
Michal S

Reputation: 1113

Highcharts: How to resize chart from external JS?

I have two charts on a page, their codes stored in different files. What Im trying to achieve is: When I click on first chart, the second should change its size (lower height and width). Function that should do this is in yet another file (but I think it´s not the condition)... I tried to change the width of containing div, but it only cuts the chart. Then I tried to change the width of that div and then to load that chart again...no result.... Is it even possible to do this?

Upvotes: 2

Views: 4241

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Use setSize() function.

For example:

 chart.setSize(newWidth, newHeight);

Upvotes: 4

Related Questions