swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Want to give different bar color for each series using custom colors #1482

Open designscripting opened 4 years ago

designscripting commented 4 years ago

Is it possible to add different color for each series. using customColors? for

customColors() { result = JSON.parse('[{"name":"Used","value":"#e8c728"},{"name":"Used","value":"#FF0000"}]'); return result;
}

image

data: [ { "name": "Lineage Transformations", "series": [ { "name": "Limit", "value": 0 }, { "name": "Used", "value": 0 } ] }, { "name": "Data sources", "series": [ { "name": "Limit", "value": 10 }, { "name": "Used", "value": 0 } ] } ]

Sample: https://stackblitz.com/edit/swimlane-grouped-vertical-bar-chart-cn1o4k

tekagesolutions commented 3 years ago

I'm interested in knowing this as well. I have 3 data labels being used in different charts (On Time, Late, Cancelled). It would be nice to know I can assign Color 1 => OnTime, Color 2 => Late, and Color 3 => Cancelled consistently.

dazzzed commented 8 months ago

Hi guys, any solution found for this?