mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Check color, dont bind (#13922)
This commit is contained in:
parent
f46553b9c4
commit
639c569b08
1 changed files with 17 additions and 7 deletions
|
@ -63,18 +63,22 @@ module.exports = function timechartFn(Private, config, $rootScope, timefilter, $
|
|||
position: 'nw',
|
||||
labelBoxBorderColor: 'rgb(255,255,255,0)',
|
||||
labelFormatter: function (label, series) {
|
||||
const wrapperSpan = document.createElement('span');
|
||||
const labelSpan = document.createElement('span');
|
||||
labelSpan.setAttribute('class', 'ngLegendValue');
|
||||
labelSpan.setAttribute('kbn-accessible-click', '');
|
||||
labelSpan.setAttribute('ng-click', 'toggleSeries(' + series._id + ')');
|
||||
labelSpan.appendChild(document.createTextNode(label));
|
||||
|
||||
const numberSpan = document.createElement('span');
|
||||
|
||||
wrapperSpan.setAttribute('class', 'ngLegendValue');
|
||||
wrapperSpan.setAttribute('kbn-accessible-click', '');
|
||||
wrapperSpan.setAttribute('ng-click', 'toggleSeries(' + series._id + ')');
|
||||
|
||||
labelSpan.setAttribute('ng-non-bindable', '');
|
||||
labelSpan.appendChild(document.createTextNode(label));
|
||||
numberSpan.setAttribute('class', 'ngLegendValueNumber');
|
||||
|
||||
labelSpan.appendChild(numberSpan);
|
||||
wrapperSpan.appendChild(labelSpan);
|
||||
wrapperSpan.appendChild(numberSpan);
|
||||
|
||||
return labelSpan.innerHTML;
|
||||
return wrapperSpan.outerHTML;
|
||||
}
|
||||
},
|
||||
colors: ['#01A4A4', '#C66', '#D0D102', '#616161', '#00A1CB', '#32742C', '#F18D05', '#113F8C', '#61AE24', '#D70060']
|
||||
|
@ -220,6 +224,12 @@ module.exports = function timechartFn(Private, config, $rootScope, timefilter, $
|
|||
}));
|
||||
series._id = index;
|
||||
|
||||
if (series.color) {
|
||||
const span = document.createElement('span');
|
||||
span.style.color = series.color;
|
||||
series.color = span.style.color;
|
||||
}
|
||||
|
||||
if (series._hide) {
|
||||
series.data = [];
|
||||
series.stack = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue