Manage color attribute on graph view

issue6341
review35281002
This commit is contained in:
Sergi Almacellas Abellana
2017-03-30 14:57:53 +02:00
parent b1db8a7ea6
commit 367242ab53
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Manage color attribute on graph view
* Add support for size on Many2Many
* Allow to show plain text in password field
+12
View File
@@ -221,6 +221,18 @@
}
};
}
var colors = {};
for (var i = 0; i < this.yfields.length; i++) {
var field = this.yfields[i];
if (field.color) {
colors[field.name] = field.color;
}
}
c3_config.data.color = function(color, column) {
// column is an object when called for legend
var name = column.id || column;
return colors[name] || color;
};
return c3_config;
},
action: function(data, element) {