Ngx-charts: Change X and Y axis color.

Created on 3 Feb 2017  路  7Comments  路  Source: swimlane/ngx-charts

I'm submitting a ..... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[x] support request => Please do not submit support request here

How can I change the color for X and Y axis data. I have to change the font color of the underline data.

image

Question

Most helpful comment

You can override the CSS of any element like here:

https://github.com/swimlane/ngx-charts/blob/master/demo/app.component.scss#L218

All 7 comments

I'm not sure I understand this. What are you trying to change the color of?

@marjan-georgiev I have a black background and I want to change the color for the text to white which show 8,500,000 etc.

You can override the CSS of any element like here:

https://github.com/swimlane/ngx-charts/blob/master/demo/app.component.scss#L218

@marjan-georgiev it is changing for all the others too . I just want to change for the particular text. Not all

You want the color changed only for the text saying 8,500,000 but not the others? That is not possible to do through the library.

Ohh okay so there is no way other way do that right ?

@MateenKadwaikar I managed to do this through selecting the CSS child. The following code will change the colour of the '2010' label.

::ng-deep .ngx-charts { .x { .tick { &:first-child { text { fill: #fff; } } } } }

Was this page helpful?
0 / 5 - 0 ratings