patz
patz

Reputation: 1316

Highcharts how to make legends as data labels on scatter plot

I have a highcharts scatter plot, I want the marker to show the legend name instead of the data points, enter image description here

to this

enter image description here how can I achieve this. Any help is appreciated.

Here is the fiddle http://jsfiddle.net/pratik24/3ovbw8m9/

 dataLabels: {
               enabled: true,
            allowOverlap:false,
                align: 'left',
                x:2,
                y:15
            }

Upvotes: 1

Views: 817

Answers (1)

Jean Andre Gonzalez
Jean Andre Gonzalez

Reputation: 198

I found a posible solution, you can add a formatter in the dataLabels

 formatter:function(){
                return this.series.name;
            }

and in the legend you can add

          labelFormatter: function () {
            //you can return something
            return '-';
        }

here the fiddle http://jsfiddle.net/jgonzalez315/885pobv6/2/

I hope this help!

Upvotes: 1

Related Questions