parent
24c7fdf67f
commit
fbd00dcced
|
@ -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…
Reference in a new issue