It is currently Thu Apr 17, 2014 2:53 pm Advanced search

Different colors for different column dataLabels

Technical support, bug reports and more.

Different colors for different column dataLabels

Postby htrufan » Mon Feb 20, 2012 5:35 pm

Hi,
I am trying to find out how to have different dataLabel colors for different columns.
Kind of like this:
Code: Select all
                    plotOptions: {
                       column: {
                          dataLabels: {
                             enabled: true,
                             formatter: function() {
                                return this.point.name + (this.point.x === 0 ? '%' : 'pp');
                             },
                             color: this.point.x === 0 ? '#005712' : '#CC0000' // ** does not work (obviously) **
                          },
                    }
                    },


I also tried dataLabels under series.data, but no luck there either.

Code: Select all
                    series: [{
                       data: [
                              {y: data.valueActual, low: 0, name: data.valueActual, color: {
                                 linearGradient: [0, 0, 0, data.valueActual],
                                 stops: [
                                        [0, '#CCCCCC'],
                                       [1, '#FFFFFF']
                                     ]},
                                     dataLabels: {
                                        color: '#00FF00' // ** seems to be ignored **
                                     }
                              },


Thanks.
htrufan
 
Posts: 8
Joined: Wed Feb 08, 2012 6:31 pm

Re: Different colors for different column dataLabels

Postby Fusher » Wed Feb 22, 2012 4:22 pm

Well, look at this example: http://jsfiddle.net/sqBfK/ they works..
Paweł Fus
Highcharts support team
Fusher
 
Posts: 5215
Joined: Mon Jan 30, 2012 12:16 pm

Re: Different colors for different column dataLabels

Postby htrufan » Thu Feb 23, 2012 1:33 pm

Thanks Fusher. It appears you can't use dataTable.color you have to use dataTable.style.color.
htrufan
 
Posts: 8
Joined: Wed Feb 08, 2012 6:31 pm


Return to Highcharts Usage

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 6 guests