jbkunst
jbkunst

Reputation: 3029

How can I get a chart only with legends using highcharts

I have various highcharts containers/charts without legend each in a grid. Now I want to create a highcharts but only want to show the legends to represent the previous data in the previous charts.

I've try to create a chart using spacing: [0,0,0,0] and a lot of series without data { data: [] }, { data: [] } but I can't get the legend in the middle of the container jsfiddle

As you see, there's a space I can't remove yet. I trid use padding in the legend option without success

Thanks in advance.

Upvotes: 1

Views: 1294

Answers (1)

Grzegorz Blachliński
Grzegorz Blachliński

Reputation: 5222

You can use legend.verticalAlign, legend.maxHeight and legend.padding parameters to position your legend in the right place:

http://api.highcharts.com/highcharts/legend.verticalAlign http://api.highcharts.com/highcharts/legend.maxHeight http://api.highcharts.com/highcharts/legend.padding

legend: {
  padding: 0,
  margin: 0,
  verticalAlign: 'middle',
  maxHeight: 200
},

Here you can see an example how it can work: http://jsfiddle.net/dq4tr387/2/

Upvotes: 2

Related Questions