Reputation:
I am using HighCharts (horizontal) bar chart. This chart is very long down my page, which is fine, and so I was hoping to have the legend show up at the top and bottom of the chart. Is this possible? I cannot find in the API how to do this.
Thanks for any tips.
Upvotes: 4
Views: 15061
Reputation: 11
I also got it and found this way to solve it
try adding these code in options:
chart: {
marginTop:-10//for top position
},
hope it helps you
Upvotes: 0
Reputation: 37578
You can add extra legend by CSS / html styles.
http://jsfiddle.net/Ecrww/109/
$(chart.series).each(function(i, serie){
$('<li style="color: '+serie.color+'">'+serie.name+'</li>').click(function(){
serie.visible ? serie.hide() : serie.show();
}).appendTo('#legend')
})
Upvotes: 4
Reputation: 329
Try removing the following code
legend:
{
layout: 'vertical',
align: 'right',
verticalAlign: 'top'
......
......
}
which makes the legend to default position
Upvotes: 1