This is a migrated thread and some comments may be shown as answers.

Text Color of Series Items labels

2 Answers 81 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 07 May 2012, 12:22 AM
How do you change the text color of a series item label.  I cannot see some of them sometimes because the color is similar tot he bar and the grid sometimes puts them over the bar.  I can see where to change the fill style like the following code but I want to change the text color itself.

        foreach (ChartSeriesItem c in chrtBar.Series[0].Items)
        {
            //I want to change the text color here.
            c.Label.Appearance.FillStyle.MainColor = System.Drawing.Color.Red;

            

        }

2 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 10 May 2012, 09:18 AM
Hi Randy,

You need to use the TextProperties in order to change the text color as shown below:
foreach (ChartSeriesItem c in chrtBar.Series[0].Items)
{
    c.Label.TextBlock.Appearance.TextProperties.Color = Color.Red;
}

Greetings,
Sia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jason Sheats
Top achievements
Rank 1
answered on 01 Nov 2012, 06:54 PM
Thank you very much.  It worked perfectly.
Tags
Chart (Obsolete)
Asked by
Randy
Top achievements
Rank 1
Answers by
Sia
Telerik team
Jason Sheats
Top achievements
Rank 1
Share this question
or