简体   繁体   中英

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, 在此处输入图片说明

to this

在此处输入图片说明 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
            }

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM