Skip to content

Commit

Permalink
Closes elastic#1720. Now pie charts with a single value for its first…
Browse files Browse the repository at this point in the history
… slice and multiple values for each layer on top of that will display a llegend as intended.
  • Loading branch information
stormpython committed Oct 28, 2014
1 parent 1db61de commit abfeb41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kibana/components/vislib/lib/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ define(function (require) {
_.forEach(visData, function countSeriesLength(obj) {
var rootSeries = obj.series || (obj.slices && obj.slices.children);
var dataLength = rootSeries ? rootSeries.length : 0;
var label = dataLength === 1 ? rootSeries[0].name : undefined;
var label = dataLength === 1 ? rootSeries[0].label || rootSeries[0].name : undefined;
var children = (obj.slices && obj.slices.children && obj.slices.children[0].children);

if (!this.seriesLabel) {
this.seriesLabel = label;
Expand All @@ -107,7 +108,7 @@ define(function (require) {
sameSeriesLabel = false;
}

if (dataLength > 1 || !sameSeriesLabel) {
if (dataLength > 1 || children || !sameSeriesLabel) {
isLegend = true;
}
});
Expand Down

0 comments on commit abfeb41

Please sign in to comment.