RadarChart - Setting line thickness and color

5 posts, 0 answers
  1. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 30 May 2014 Link to this post

    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
  2. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 04 Jun 2014 Link to this post

    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.
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 04 Jun 2014 in reply to Dimitar Link to this post

    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
  5. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 05 Jun 2014 in reply to Dimitar Link to this post



    You mention:

    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");


    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.
  6. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 06 Jun 2014 Link to this post

    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.
     
Back to Top
UI for WinForms is Visual Studio 2017 Ready