Ngx-charts: Add Color to data

Created on 17 Nov 2017  路  3Comments  路  Source: swimlane/ngx-charts

I'm submitting a ...

[x ] feature request

Current behavior

Please add the ability to add a color to data. I think this could be a nice and useful way to define the colors for chart items. e.g.

export let single = [
{
'name': 'Germany',
'value': 8940000,
'color': 'red'
},
{
'name': 'USA',
'value': 5000000,
'color': 'green'
},
{
'name': 'France',
'value': 7200000,
'color': 'blue'
}
];

All 3 comments

You can use the customColors property for that: https://github.com/swimlane/ngx-charts/issues/269

@marjan-georgiev The problem is that we need set a custom color for an specific serie: https://stackoverflow.com/questions/51748555/custom-color-for-specific-serie-using-ngx-charts, please check this.

I think that design would be better. But I would also be interested, why we have the api via the customColors right now and what's the benefit of that.

Was this page helpful?
0 / 5 - 0 ratings