# Change Chart Legend and X & Y Axis Font Color

**URL:** <https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317>\
**Category:** Radzen.Blazor Components\
**Created:** [October 18, 2020, 9:29am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317 "2020-10-18T09:29:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![radzenkenn](https://forum.radzen.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@radzenkenn](https://forum.radzen.com/u/radzenkenn)\
**Post date:** [October 18, 2020, 9:29am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/1 "2020-10-18T09:29:47Z")

</div>

Hi, does anyone know of a way to change the font color of the legend, x & y axis for the various charts? The font color seem to default to a muted gray and that works great against a light background but I would like to be able to use a chart against a dark background (and use themes).

I cannot apply the normal 'style' attribute/markup because the legend, x & y axis components of the Radzen charts are currently designed where you can't apply the 'style' attribute/markup, and I do not know which Css class to change to modify the font color. Thank you.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [October 19, 2020, 5:06am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/2 "2020-10-19T05:06:45Z")

</div>

Check the [Chart API](https://www.radzen.com/documentation/blazor/chart/#api).

---

<div class="post-metadata">

**Author:** ![radzenkenn](https://forum.radzen.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@radzenkenn](https://forum.radzen.com/u/radzenkenn)\
**Post date:** [October 19, 2020, 10:26am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/3 "2020-10-19T10:26:36Z")

</div>

Thanks for the relpy korcheve, but your API and documentation are the first places I look. Then when I can't figure out or see something missing, that is when I pose question here.

When I looked at your current (assuming it is updated fairly well to keep up with enhancements) API for the charts, using this as a reference [RadzenCategoryAxis](https://www.radzen.com/documentation/blazor/chart/#radzencategoryaxis), the only properties/methods dealing with the labels are FormatString and Formatter -- and none of these can change the font color of the axis. Is your API document complete or does the current Radzen charts do not have this capability?

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [October 19, 2020, 11:32am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/4 "2020-10-19T11:32:53Z")

</div>

![image](https://forum.radzen.com/uploads/default/original/2X/6/698d14bdf35a01c5ff901c1c56a3ee1879092aeb.png)

This is the very first property of the RadzenCategoryAxis.

---

<div class="post-metadata">

**Author:** ![radzenkenn](https://forum.radzen.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@radzenkenn](https://forum.radzen.com/u/radzenkenn)\
**Post date:** [October 20, 2020, 12:09pm UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/5 "2020-10-20T12:09:46Z")

</div>

Hi korchev:

I already tried that but here it is again. . . ..

I don't think the Stroke property works properly if it's also meant to affect the color of the font. Below is a snapshot to better illustrate the point. I want to change the color of the text (font) labeling of the axis (the dollar values, "Revnue in USD", the "Q1", "Q2", "Q3", etc.) so I can use the Radzen charts against a dark background like the example "Safety KPI" at the top. The Stroke property only affects the color of the axis, not the text, and this was my original query.

```
<RadzenCategoryAxis Stroke="red" />
<RadzenValueAxis Stroke="red" Formatter="@FormatAsUSD">
      <RadzenGridLines Visible="true" />
      <RadzenAxisTitle Text="Revenue in USD" />
</RadzenValueAxis>

```

 ![image](https://forum.radzen.com/uploads/default/original/2X/1/1538c131f2563800d0c13c26da88a3ace9a0ee1a.png)

---

<div class="post-metadata">

**Author:** ![JonL](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.radzen.com/u/JonL)\
**Post date:** [May 6, 2022, 7:41am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/6 "2022-05-06T07:41:04Z")

</div>

Hello,

I'm also having the same issue as well.  
Setting the stroke will only change the line color, but not the text color.

Is there a way to adjust this?

Thanks,  
-Jon Langford

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [May 6, 2022, 7:46am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/7 "2022-05-06T07:46:31Z")

</div>

> [@JonL](#):
>
> Setting the stroke will only change the line color, but not the text color.

Indeed, the stroke property only changes the line color. It does not affect the text.

> [@JonL](#):
>
> Is there a way to adjust this?

Yes, you can set the text color via CSS:

```auto
text.rz-tick-text {
   fill: red;
}

```

---

<div class="post-metadata">

**Author:** ![JonL](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.radzen.com/u/JonL)\
**Post date:** [May 6, 2022, 7:49am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/8 "2022-05-06T07:49:37Z")

</div>

Fantastic! That worked perfectly!

Thank you so much for you help

---

<div class="post-metadata">

**Author:** ![john\_town](https://forum.radzen.com/user_avatar/forum.radzen.com/john_town/32/13177_2.png) [@john\_town](https://forum.radzen.com/u/john_town)\
**Post date:** [February 5, 2023, 6:20am UTC](https://forum.radzen.com/t/change-chart-legend-and-x-y-axis-font-color/5317/9 "2023-02-05T06:20:32Z")

</div>

where do you put/specify this CSS definition?
