Highcharts for single bubbles

The new Highcharts v3.0 bubble chart looks great. Is it possible to annotate and display each bubble with a name / some text? Thanks, Nigel.

+5
source share
2 answers

There are two things you need to do.

First name each data point (bubble):

data: [
  { name: 'Alice', x: 3.5, y: 4, z: 5}, 
  { name: 'Eve', x: 7, y: 7, z: 3}, 
  { name: 'Carol', x: 4, y: 8, z: 6}
]

Secondly, create a data label formatter:

dataLabels: {
  enabled: true,
  formatter: function() {
    return this.point.name;
  }
}

You can see it in action here: http://jsfiddle.net/franzo/JuGDp/1/

Bob is your uncle.

+13
source

, , . , . - dataLabels http://api.highcharts.com/highcharts#plotOptions.scatter.dataLabels

       dataLabels:{
           enabled:true
       } 

. http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-datalabels-box/

, , , http://api.highcharts.com/highcharts#Renderer, , . , .

datalabels : http://jsfiddle.net/4nRk6/

Datalabels , :

 dataLabels: {
           enabled: true,
           formatter: function() {
                    return this.y +'mm';
           }
 }  

: http://api.highcharts.com/highcharts#plotOptions.column.dataLabels

, :

[
    {x:1, y:5, bubbleText:"Bubble 1"},
    {x:2, y:15, bubbleText:"Bubble 2"},
    {x:3, y:5, bubbleText:"Bubble 3"}
]

dataLabel this.point.bubbleText, this.x this.y.

+3

All Articles