I've tried lots of binations in the legend options of the highcharts object, however I was not able to successfully realize the exact design that the designer made.
What I need is to be able to have a legend that looks exactly like this... Wanted legend layout
But the closest result that I achieved with the legend options available was this... The closest legend layout I could achieve
The properties I used within the highchart object definition were:
legend: {
enabled: graphProperties.legend.enabled,
backgroundColor: ...
borderRadius: ...
verticalAlign: ...
align: ...
borderWidth: ...
x: ...
y: ... }
Thank you in advance for any help.
I've tried lots of binations in the legend options of the highcharts object, however I was not able to successfully realize the exact design that the designer made.
What I need is to be able to have a legend that looks exactly like this... Wanted legend layout
But the closest result that I achieved with the legend options available was this... The closest legend layout I could achieve
The properties I used within the highchart object definition were:
legend: {
enabled: graphProperties.legend.enabled,
backgroundColor: ...
borderRadius: ...
verticalAlign: ...
align: ...
borderWidth: ...
x: ...
y: ... }
Thank you in advance for any help.
Share Improve this question asked May 11, 2012 at 15:49 DiscoPapaDiscoPapa 1,0442 gold badges14 silver badges27 bronze badges 2- 1 If possible can you throw up a sample set of data and code on jsFiddle? – wergeld Commented May 11, 2012 at 16:23
- Sure, I'll try ass soon as I get back to work, since I cannot get to my work puter right now. – DiscoPapa Commented May 12, 2012 at 20:58
1 Answer
Reset to default 6Maybe you can use this as a starting point.
http://jsfiddle/DqAqu/4/
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
backgroundColor: '#F5F5F5',
plotBackgroundColor: '#FFFFFF'
},
symbols: [ 'square', 'square' ],
legend: {
backgroundColor: '#F5F5F5',
layout: 'horizontal',
floating: true,
align: 'left',
verticalAlign: 'top',
x: 60,
y: 1,
shadow: false,
border: 0,
borderRadius: 0,
borderWidth: 0
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
color: '#47D147'
}, {
data: [95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1],
color: '#19A3FF'
}]
});
});