Using JQPlot, how can I place the legend outside the chart in a specific location?

Shane Geist picture Shane Geist · Jul 20, 2013 · Viewed 13.2k times · Source

I am using the following to successfully place the legend outside my JQPlot line chart:

legend: { show: true, location: 'sw', placement: 'outside' },

However, this places the legend too close to the chart, in line with my yaxis labeling. I need to move it further to the left. Is there a way to do this?

Thanks.

Answer

willily picture willily · Nov 19, 2014

A bit late, sure, but I got it! You should use placement: 'outsideGrid' instead of placement: 'outside' as 'outsideGrid' will shrink the graph area for the legend not to be mixed with it.

Hope this help!

Nico