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

Bar color change

5 Answers 152 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nirmal
Top achievements
Rank 1
Nirmal asked on 10 Sep 2009, 09:54 AM
Hai,
    I am using 2D Bar Chart. I want to show the first value in XAxis As Blue and Second value in XAxis as Red. And also i have to show Blue(In 0) as "String1" and Red(in 1) as "String2" in ChartArea.How can i do this?

Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 15 Sep 2009, 08:48 AM
Hi Nirmal,

Currently there is no way to customize the axis colors in such a way. Setting the labels can be easily done by modifying the TickPoints collection of the AxisX in the ChartArea.

To ensure that the TickPoints collection is not regenerated, I suggest setting:
this.chartArea.AxisX.AutoRange = false
this.chartArea.AxisX.AddRange(0, 1, 1); 

Best,
Evtim
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Neeraj
Top achievements
Rank 1
answered on 22 Sep 2009, 04:30 AM
Hi,

I have the same problem,Does it now possible to change the color of Bar.

Thanks,
Neeraj
0
Dwight
Telerik team
answered on 24 Sep 2009, 10:22 AM
Hello Neeraj,

Can you, please, give us more details on your expected scenario? Other than that, I suggest looking at the MVVM example in our QSF. Note, that the example is also available in the WPF version of the chart.

Kind regards,
Evtim
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pams
Top achievements
Rank 1
answered on 05 Oct 2010, 11:32 AM
Hello,
I am very new to this telerik reporting.
I have a bar chart with the names on the x-aixs and cost on y-axis. With some fill type the values on the x-aixs and y-axis are becoming dull and hard to read. Also, when the names are long they are getting overlapped.
Can any one please tell me how to change the colors of the values on axis to some color lets say black. And how to display the x-axis values in some inclined manner instead of horizontally.
Thanks in advance.
0
Evgenia
Telerik team
answered on 07 Oct 2010, 06:23 PM
Hello Pams,

To be able to change colors of Axis Item labels you should change it's foreground. For achieving this you can use the AxisForeground property of the RadChart like this:

radChart1.AxisForeground = new SolidColorBrush(Colors.Black);
NOTE that the value of this property will get applied to all of the axis item labels and all of the axis titles.

To rotate Axis Item Labels you should use LabelRotationAngle property described here: http://www.telerik.com/help/wpf/radchart-features-axes-x-axis.html.
Here is how you can set some value to it:
radChart1.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;

Hope this answers your questions.

Best wishes,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Nirmal
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Neeraj
Top achievements
Rank 1
Pams
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or