This commit is contained in:
Bernd Hacker
2017-06-13 19:04:27 +02:00
parent c67273c360
commit 4afd3d92e5
+16
View File
@@ -2537,3 +2537,19 @@ function style_grid() {
}
});
}
// set colors via function
c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', ...[]],
],
type: 'bar',
colors: {
data1: (d: any) => {
return d.value > 90 ? 'green' : 'orange';
}
}
}
});