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?
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?
Share Improve this question edited Oct 3, 2022 at 11:49 Donald Duck 8,90223 gold badges79 silver badges102 bronze badges asked Jul 20, 2013 at 21:54 Shane GeistShane Geist 311 gold badge1 silver badge3 bronze badges 2- refer to this post, i have posted the answer is-it-possible-to-write-legend-to-a-separate-division-with-jqplot – Gyandeep Commented Jul 21, 2013 at 8:04
- Here is the answer, maybe some other developers needs. stackoverflow./a/20047827/2371672 – burakerk Commented Oct 13, 2015 at 8:21
3 Answers
Reset to default 7A 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.
Checkout the marginTop, marginRight, marginBottom, marginLeft properties for Legend.
You should be able to do:
legend: {
show: true,
location: 'sw',
placement: 'outside',
marginLeft: 300
}
You have to use it like this. marginLeft : "300px"
legend: {
show: true,
location: 'sw',
placement: 'outside',
marginLeft: "300px"
}