Back to amCharts.com

Adding more space for chart legend and axis values

One of the most freqent problems that our customers have is: "My legend doesn't fit, some of the legend items are out of the Flash object area".

As you might notice from the examples, the chart's legend can be placed anywhere on the chart - you can set the legend's coordinates by setting <legend><x> and <legend><y>. However, by default the chart's legend is displayed below the plot area. If your chart has a lot of graphs (slices), some of the legend entries might go outside the Flash area. To avoid this, you should make the plot area smaller. The plot area size is controlled by setting the plot area margins:

<plot_area>
  <margins>                   
    <left></left> 
    <top></top>
    <right></right> 
    <bottom></bottom>
  </margins>
</plot_area>

So, if your legend is in a default position, and it doesn't fit, you should increase the size of a bottom margin. Or, if you want to place your legend on the right size, and need more space for it, adjust the <right> margin.

The same goes for axis values - if your numbers are big and are wrapping, you should increase the size of a <left> margin (if this is a left axis).

Back to top