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

RadarChart - Setting line thickness and color

4 Answers 346 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 30 May 2014, 11:30 AM
Hi again,

I have successfully implemented a radar area line chart as per attached image. I have the following questions:

(a) How I can programmatically change the thickness of the displayed line?

(b) How I can change the colour of each category line depending on the value, e.g. value =100 will be red, value =10 will be blue and so on.

Regards,


George

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 04 Jun 2014, 08:29 AM
Hello George,

Thank you for writing.

1. You can change the line thickness and color by changing the BorderColor and BorderWidth properties:
RadarLineSeries series = new RadarLineSeries();
series.Spline = true;
 
series.BorderColor = Color.DarkKhaki;
series.BorderWidth = 5;

2. If you want to change the grid lines color you can just set the grids ForeColor property:
PolarGrid grid = this.radChartView1.Area.GetGrid<PolarGrid>();
grid.ForeColor = Color.Red;

However you cannot set different color for each line. In this case I want to suggest you to set some custom background to the chart:
radChartView1.ChartElement.Image = Image.FromFile(@"C:\myImage.png");

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
George
Top achievements
Rank 1
answered on 04 Jun 2014, 08:46 AM
Hi, thks for reply. If I cannot change the individual line color could you please guide me how to change the color as values change? I need to grasp the event that some value has changed and then to apply a color depending on the value.

Regards,

George
0
George
Top achievements
Rank 1
answered on 05 Jun 2014, 02:03 PM


You mention:

[quote]However you cannot set different color for each line. In this case I want to suggest you to set some custom background to the chart:
radChartView1.ChartElement.Image = Image.FromFile(@"C:\myImage.png");
[/quote]

However from this link http://www.telerik.com/help/winforms/chartview-customization-custom-rendering.html   I can see that there is a way to do this for a line series, althaugh I am not sure how I can implement it for a radar line series.
0
Dimitar
Telerik team
answered on 06 Jun 2014, 12:37 PM
Hi George, 

Thank you for writing back.

I was thinking that you want to change the grid lines (each category has a grid line that come from the chart center and goes to the category name). I noticed that you have posted a separated tread for this I am pasting the answer here in order the community to benefit from it:

The example can be recreated to draw different part of the line with a different color. However in this case there is no way to place the corresponding color to a specific place (line part) in the chart. Nevertheless I have attached the recreated sample in case you want to look at it.

Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ChartView
Asked by
George
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
George
Top achievements
Rank 1
Share this question
or