Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts Symbol in Legend

I have a highcharts legend where the symbols are displaying with varying sizes as they are different sizes in the actual chart. Unfortunately, when the sizes of the data points grow, they also grow in the legend. I want the legend symbols to remain the same size regardless of the data point size.

Here is an example where the data points have grown with the graph. In case it matters, the actual graph I'm using is a scatter plot (unlike the example).

http://jsfiddle.net/RsUhk/

Any help is much appreciated!

like image 754
Robert Avatar asked Feb 20 '23 13:02

Robert


1 Answers

This is a little hacky but it's the best I can come up with. After you draw the plot, manually adjust the legend symbols:

$(chart.series).each(function(){
    this.legendSymbol.attr('width',8);
    this.legendSymbol.attr('height',8);
    this.legendSymbol.attr('x',this.legendLine.attr('translateX')-17);
    this.legendSymbol.attr('y',this.legendLine.attr('translateY')-4);
});

Updated fiddle here.

like image 64
Mark Avatar answered Mar 03 '23 15:03

Mark