title: Angular2-Highcharts: Pie chart size based on the width of the panel
body: <p>I have created a Pie chart and I am placing this Pie chart inside a panel. My panel width can be 600 or 400 depending on the user settings. When the size is 600 Pie and the legend is displayed properly. But when it is 400, the legend is displayed outside of the panel. Is there a way to reduce the size of the pie in that case, also the legend can be displayed at the bottom if the size is not sufficient.</p>
  
  <p>My plnkr</p>
  
  <p><a href="https://plnkr.co/edit/yzXLz7AIDoWa1Pzxxl4k?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/yzXLz7AIDoWa1Pzxxl4k?p=preview</a></p>
  
  <p>My plot options</p>
  
  <pre><code> plotOptions: {
                  pie: {
  
                      innerSize: 120,
                      allowPointSelect: true,
                      cursor: 'pointer',
                      dataLabels: {
                          enabled: false
                      },
                      showInLegend: true,
                      states: {
                        hover: {
                          halo: {
                            size: 0
                          }
                        }
                      }
                  }
              },
  </code></pre>
  
  <p>Response code:</p>
  
  <p>responsive: {</p>
  
  <pre><code>                    rules: [{
                              condition: {
                                  maxWidth: 500
                              },
                              chartOptions: {
                                  legend: {
                                      align: 'center',
                                      verticalAlign: 'top',
                                      layout: 'horizontal',
                                      labelFormatter: function () {
                                         return '&lt;div style="width:180px"&gt;&lt;span class="pull-left" style= "font-weight: 500; padding-bottom: 5px; font-family:Helvetica "&gt;' + this.name +
                  '&lt;/span&gt;&lt;span class="pull-right" style= "font-weight: 500" &gt;' + this.value +
                  '&lt;/span&gt;&lt;/div&gt; ';
                                      }
                                  },
                                  pie: {
                                      size: 100,
                                      innerSize: 40
                                  }
                              }
                          }]
                  }
  </code></pre>