Articles in this section
Category / Section

How to change the text color of the legend in the React Pie Charts?

2 mins read

Description

This article explains how to change the text color of the legend in the React Pie Charts.

Solution

A legend provides information about the different elements or data series represented on the graph. By default, the text color of the legend is black for light themes and white for dark themes.

However, if you wish to change the text color, you can use the color property of the textStyle in legendSettings. This way, you can customize the legend to fit your needs and preferences.

Code Snippet

<AccumulationChartComponent
  id="pie-chart"
  legendSettings={{ visible: true, textStyle: { color: "red" } }}>              
</AccumulationChartComponent>

The following image illustrates the output of the above code:

image.png

Refer to the working sample for additional details and implementation: View Sample in Stackblitz

Conclusion

We hope you enjoyed learning how to change the text color of the legend in the React Pie Chart.

You can refer to our React Charts feature tour page to learn about its other features and documentation, and how to quickly get started for configuration specifications. You can also explore our React Charts example to understand how to create and visualize data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free-trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comment section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied