Feature request: Add Fill to enable color change of RadzenSeriesDataLabels text #1681

Closed
opened 2026-01-29 17:57:11 +00:00 by claunia · 5 comments
Owner

Originally created by @joetaylor010 on GitHub (Mar 26, 2025).

This request is similar to https://github.com/radzenhq/radzen-blazor/issues/1789, which saw the "Fill" property added to RadzenSeriesAnnotation.

I noticed that the RadzenSeriesDataLabels object used in StackedColumnSeries also lacks this property.

Please, add Fill property to RadzenSeriesDataLabels so that we can set the text color.

Image

Suggested code: <RadzenSeriesDataLabels Fill="white" />

Originally created by @joetaylor010 on GitHub (Mar 26, 2025). This request is similar to https://github.com/radzenhq/radzen-blazor/issues/1789, which saw the "Fill" property added to RadzenSeriesAnnotation. I noticed that the RadzenSeriesDataLabels object used in StackedColumnSeries also lacks this property. Please, add Fill property to RadzenSeriesDataLabels so that we can set the text color. ![Image](https://github.com/user-attachments/assets/03d20454-40bb-453d-9cb7-c43480d64c12) Suggested code: `<RadzenSeriesDataLabels Fill="white" />`
claunia added the good first issue label 2026-01-29 17:57:11 +00:00
Author
Owner

@akorchev commented on GitHub (Mar 30, 2025):

Hi @joetaylor010,

This should be an easy addition. You can try submitting it as a pull request. If not we will definitely add it along the road.

@akorchev commented on GitHub (Mar 30, 2025): Hi @joetaylor010, This should be an easy addition. You can try submitting it as a pull request. If not we will definitely add it along the road.
Author
Owner

@pedro-cons commented on GitHub (Apr 6, 2025):

Hi @akorchev and @joetaylor010,

I’ve added the Fill support with this snippet:

<RadzenSeriesDataLabels Visible="@showDataLabels" Fill="white" />

<Text @key="@($"{label.Position}-{Chart.Series.IndexOf(series)}")"
      Value="@label.Text" Position="@label.Position" Fill="@Fill"
      TextAnchor="@label.TextAnchor" class="@GetSeriesDataLabelClass()" />

public string GetSeriesDataLabelClass() =>
    string.IsNullOrWhiteSpace(Fill) ? "rz-series-data-label" : "rz-series-data-label-fill";

https://github.com/user-attachments/assets/819b9e12-9add-470f-8a7a-1d13b4c8c6ec

Does this approach solve the need?
If it looks good, I can open a PR with the full implementation with more details and test coverage.

Thanks!

@pedro-cons commented on GitHub (Apr 6, 2025): Hi @akorchev and @joetaylor010, I’ve added the Fill support with this snippet: ``` <RadzenSeriesDataLabels Visible="@showDataLabels" Fill="white" /> <Text @key="@($"{label.Position}-{Chart.Series.IndexOf(series)}")" Value="@label.Text" Position="@label.Position" Fill="@Fill" TextAnchor="@label.TextAnchor" class="@GetSeriesDataLabelClass()" /> public string GetSeriesDataLabelClass() => string.IsNullOrWhiteSpace(Fill) ? "rz-series-data-label" : "rz-series-data-label-fill"; ``` https://github.com/user-attachments/assets/819b9e12-9add-470f-8a7a-1d13b4c8c6ec Does this approach solve the need? If it looks good, I can open a PR with the full implementation with more details and test coverage. Thanks!
Author
Owner

@joetaylor010 commented on GitHub (Apr 7, 2025):

Hi @pedro-cons, the functionality of the demo looks perfect however I'll defer to more knowledgeable contributors on judging the approach.

@joetaylor010 commented on GitHub (Apr 7, 2025): Hi @pedro-cons, the functionality of the demo looks perfect however I'll defer to more knowledgeable contributors on judging the approach.
Author
Owner

@pedro-cons commented on GitHub (Apr 17, 2025):

Hey Guys,

I believe we can close this issue if the proposed PR is considered valid.

Thanks!

@pedro-cons commented on GitHub (Apr 17, 2025): Hey Guys, I believe we can close this issue if the proposed PR is considered valid. Thanks!
Author
Owner

@akorchev commented on GitHub (Apr 17, 2025):

It sure is! Thanks!

@akorchev commented on GitHub (Apr 17, 2025): It sure is! Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1681