Skip to content

Commit

Permalink
Merge pull request #1756 from stormpython/fix_1720
Browse files Browse the repository at this point in the history
Fixes #1720. Legend not displaying when multiple types - pie chart.
  • Loading branch information
rashidkpc committed Oct 28, 2014
2 parents 40b9210 + a99967b commit 6578119
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].label : 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 (!seriesLabel) {
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 6578119

Please sign in to comment.