Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/kibana/components/vislib/lib/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ define(function (require) {
this.labels;

if (this.type === 'series') {
this.labels = getLabels(data);
if (getLabels(data).length === 1 && getLabels(data)[0] === '') {
this.labels = [(this.get('yAxisLabel'))];
} else {
this.labels = getLabels(data);
}
} else if (this.type === 'slices') {
this.labels = this.pieNames();
}

this.color = this.labels ? color(this.labels) : undefined;

this._normalizeOrdered();

this._attr = _.defaults(attr || {}, {
Expand Down Expand Up @@ -459,7 +463,7 @@ define(function (require) {
* series.rows is an array of arrays
* each row is an array of values
* last value in row array is bucket count
*
*
* @method mapDataExtents
* @param series {Array} Array of data objects
* @returns {Array} min and max values
Expand Down
2 changes: 1 addition & 1 deletion src/kibana/components/vislib/lib/handler/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define(function (require) {
this.chartTitle = opts.chartTitle;
this.axisTitle = opts.axisTitle;

if (this._attr.addLegend && this.data.isLegendShown()) {
if (this._attr.addLegend) {
this.legend = opts.legend;
}

Expand Down
2 changes: 1 addition & 1 deletion src/kibana/components/vislib/lib/handler/types/column.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define(function (require) {

return new Handler(vis, {
data: data,
legend: new Legend(vis, vis.el, data.getLabels(), data.getColorFunc(), vis._attr),
legend: new Legend(vis, vis.el, data.labels, data.color, vis._attr),
axisTitle: new AxisTitle(vis.el, data.get('xAxisLabel'), data.get('yAxisLabel')),
chartTitle: new ChartTitle(vis.el),
xAxis: new XAxis({
Expand Down
2 changes: 1 addition & 1 deletion src/kibana/plugins/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ define(function (require) {
// TODO: a legit way to update the index pattern
$scope.vis = new Vis($scope.searchSource.get('index'), {
type: 'histogram',
vislibParams: {
params: {
addLegend: false,
},
listeners: {
Expand Down