mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
cdafaad519
commit
a142e2c745
2 changed files with 12 additions and 1 deletions
|
@ -138,7 +138,7 @@ module.directive('vislibValueAxes', function () {
|
|||
if (matchingSeries.length === 1) {
|
||||
label = matchingSeries[0].makeLabel();
|
||||
}
|
||||
if (lastAxisTitles[axis.id] !== label) {
|
||||
if (lastAxisTitles[axis.id] !== label && label !== '') {
|
||||
lastAxisTitles[axis.id] = label;
|
||||
axis.title.text = label;
|
||||
}
|
||||
|
|
|
@ -104,4 +104,15 @@ describe('point series editor', function () {
|
|||
$parentScope.removeValueAxis({ id: 'ValueAxis-1' });
|
||||
expect($parentScope.vis.params.valueAxes.length).to.be(1);
|
||||
});
|
||||
|
||||
it('should set the value axis title if its not set', function () {
|
||||
$parentScope.updateAxisTitle();
|
||||
expect($parentScope.vis.params.valueAxes[0].title.text).to.equal('Count');
|
||||
});
|
||||
|
||||
it('should not update the value axis title if custom title was set', function () {
|
||||
$parentScope.vis.params.valueAxes[0].title.text = 'Custom Title';
|
||||
$parentScope.updateAxisTitle();
|
||||
expect($parentScope.vis.params.valueAxes[0].title.text).to.equal('Custom Title');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue