Skip to content

Commit

Permalink
Internal: Variable key for color axis.
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed Jun 30, 2014
1 parent d2d917b commit b5acc2b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions js/highmaps.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -15714,17 +15714,19 @@ var colorSeriesMixin = {
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',

/**
* In choropleth maps, the color is a result of the value, so this needs translation too
*/
translateColors: function () {
var series = this,
nullColor = this.options.nullColor,
colorAxis = this.colorAxis;
colorAxis = this.colorAxis,
colorKey = this.colorKey;

each(this.data, function (point) {
var value = point.value,
var value = point[colorKey],
color;

color = value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color;
Expand Down
6 changes: 4 additions & 2 deletions js/modules/heatmap.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,19 @@ var colorSeriesMixin = {
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',

/**
* In choropleth maps, the color is a result of the value, so this needs translation too
*/
translateColors: function () {
var series = this,
nullColor = this.options.nullColor,
colorAxis = this.colorAxis;
colorAxis = this.colorAxis,
colorKey = this.colorKey;

each(this.data, function (point) {
var value = point.value,
var value = point[colorKey],
color;

color = value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color;
Expand Down
6 changes: 4 additions & 2 deletions js/modules/map.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,17 +599,19 @@ var colorSeriesMixin = {
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',

/**
* In choropleth maps, the color is a result of the value, so this needs translation too
*/
translateColors: function () {
var series = this,
nullColor = this.options.nullColor,
colorAxis = this.colorAxis;
colorAxis = this.colorAxis,
colorKey = this.colorKey;

each(this.data, function (point) {
var value = point.value,
var value = point[colorKey],
color;

color = value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color;
Expand Down
6 changes: 4 additions & 2 deletions js/parts-map/ColorSeriesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ var colorSeriesMixin = {
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',

/**
* In choropleth maps, the color is a result of the value, so this needs translation too
*/
translateColors: function () {
var series = this,
nullColor = this.options.nullColor,
colorAxis = this.colorAxis;
colorAxis = this.colorAxis,
colorKey = this.colorKey;

each(this.data, function (point) {
var value = point.value,
var value = point[colorKey],
color;

color = value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color;
Expand Down

0 comments on commit b5acc2b

Please sign in to comment.