admin管理员组文章数量:1245119
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"
}
本文标签:
版权声明:本文标题:javascript - Using JQPlot, how can I place the legend outside the chart in a specific location? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740219347a2243491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论