Permalink
Browse files

Fixed issue with color:undefined in pie series data labels. Closes #342.

  • Loading branch information...
1 parent 095a366 commit 6eeb8cca8b01e6ae757bfae2dd489c0bffb83a06 highslide-software committed Aug 3, 2011
Showing with 13 additions and 11 deletions.
  1. +8 −7 js/highcharts.src.js
  2. +5 −4 js/parts/Series.js
View
15 js/highcharts.src.js
@@ -2,7 +2,7 @@
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
- * @license Highcharts JS v2.1.6 (2011-07-08)
+ * @license @product.name@ JS v@product.version@ (@product.date@)
*
* (c) 2009-2011 Torstein Hønsi
*
@@ -9326,7 +9326,8 @@ Series.prototype = {
options = series.options.dataLabels,
str,
dataLabelsGroup = series.dataLabelsGroup,
- chart = series.chart,
+ chart = series.chart,
+ renderer = chart.renderer,
inverted = chart.inverted,
seriesType = series.type,
color,
@@ -9357,7 +9358,7 @@ Series.prototype = {
// create a separate group for the data labels to avoid rotation
if (!dataLabelsGroup) {
dataLabelsGroup = series.dataLabelsGroup =
- chart.renderer.g('data-labels')
+ renderer.g('data-labels')
.attr({
visibility: series.visible ? VISIBLE : HIDDEN,
zIndex: 6
@@ -9371,7 +9372,7 @@ Series.prototype = {
if (color === 'auto') { // 1.0 backwards compatibility
color = null;
}
- options.style.color = pick(color, series.color);
+ options.style.color = pick(color, series.color, 'black');
// make the labels for each point
each(data, function (point, i) {
@@ -9412,7 +9413,7 @@ Series.prototype = {
});
// create new label
} else if (defined(str)) {
- dataLabel = point.dataLabel = chart.renderer.text(
+ dataLabel = point.dataLabel = renderer.text(
str,
x,
y
@@ -11067,7 +11068,7 @@ win.Highcharts = {
merge: merge,
pick: pick,
extendClass: extendClass,
- product: 'Highcharts',
- version: '2.1.6'
+ product: '@product.name@',
+ version: '@product.version@'
};
}());
View
9 js/parts/Series.js
@@ -1172,7 +1172,8 @@ Series.prototype = {
options = series.options.dataLabels,
str,
dataLabelsGroup = series.dataLabelsGroup,
- chart = series.chart,
+ chart = series.chart,
+ renderer = chart.renderer,
inverted = chart.inverted,
seriesType = series.type,
color,
@@ -1203,7 +1204,7 @@ Series.prototype = {
// create a separate group for the data labels to avoid rotation
if (!dataLabelsGroup) {
dataLabelsGroup = series.dataLabelsGroup =
- chart.renderer.g('data-labels')
+ renderer.g('data-labels')
.attr({
visibility: series.visible ? VISIBLE : HIDDEN,
zIndex: 6
@@ -1217,7 +1218,7 @@ Series.prototype = {
if (color === 'auto') { // 1.0 backwards compatibility
color = null;
}
- options.style.color = pick(color, series.color);
+ options.style.color = pick(color, series.color, 'black');
// make the labels for each point
each(data, function (point, i) {
@@ -1258,7 +1259,7 @@ Series.prototype = {
});
// create new label
} else if (defined(str)) {
- dataLabel = point.dataLabel = chart.renderer.text(
+ dataLabel = point.dataLabel = renderer.text(
str,
x,
y

0 comments on commit 6eeb8cc

Please sign in to comment.