1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-30 10:49:40 +02:00

Add missing files

This commit is contained in:
Michael Crosby 2013-09-02 20:35:51 -07:00
parent 9eaa75a572
commit d17adc0f9d
6 changed files with 54 additions and 26 deletions

15
lib/legend.js Normal file
View file

@ -0,0 +1,15 @@
function legend(parent, data) {
parent.className = 'legend';
var datas = data.hasOwnProperty('datasets') ? data.datasets : data;
datas.forEach(function(d) {
var title = document.createElement('span');
title.className = 'title';
title.style.borderColor = d.hasOwnProperty('strokeColor') ? d.strokeColor : d.color;
title.style.borderStyle = 'solid';
parent.appendChild(title);
var text = document.createTextNode(d.title);
title.appendChild(text);
});
}