Change RadChartView background color

5 posts, 0 answers
  1. Mathias
    Mathias avatar
    4 posts
    Member since:
    Apr 2013

    Posted 17 Apr 2015 Link to this post

    Hello,

    I'm desperately trying to change the color of the background of my chart (inside of the axis = plot area in Excel - see attached). I tried the background property for the area, the grid... I also tried to alternate the same color in my grid.

     How should I do that?

    Thanks,

    Mathias

  2. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 20 Apr 2015 Link to this post

    Hi Mathias,

    If you want to change the BackColor of the chart, you can use the following code snippet: 
    this.radChartView1.ChartElement.BackColor = Color.Aquamarine;

    If you want to change the BackColor of the area when the series are pained, please refer to the following code snippet: 
    CartesianArea area = this.radChartView2.GetArea<CartesianArea>();
    area.ShowGrid = true;
     
    CartesianGrid grid = area.GetGrid<CartesianGrid>();
    grid.DrawHorizontalFills = true;
    grid.DrawVerticalFills = true;           
    grid.DrawHorizontalStripes = false;
    grid.DrawVerticalStripes = false;
     
    area.Grid.BackColor = Color.Aquamarine;
    area.Grid.BackColor2 = Color.Aquamarine;
    area.Grid.AlternatingBackColor = Color.Aquamarine;
    area.Grid.AlternatingBackColor2 = Color.Aquamarine;

    In the attachments you can find the image and the sample demo project how to achieved it. 

    Should you have further questions, I would be glad to help. 

    Regards,
    Ralitsa
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mathias
    Mathias avatar
    4 posts
    Member since:
    Apr 2013

    Posted 20 Apr 2015 in reply to Ralitsa Link to this post

    Thanks Ralitsa,

    it's working fine now!

    Best,

    Mathias

  5. Alexander
    Alexander avatar
    4 posts
    Member since:
    Jun 2014

    Posted 24 Nov 2015 Link to this post

    A question regarding this, is it possible to do the opposite (i.e paint only the area outside of the area where the series are being painted)?

     

  6. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 25 Nov 2015 Link to this post

    Hi Alexander,

    Thank you for contacting us. 

    Yes, you can change that BackColor of area. Please refer to the code snippet below how to achieve it: 
    this.radChartView1.ChartElement.BackColor = Color.Aquamarine;
     
    CartesianArea area1 = this.radChartView1.GetArea<CartesianArea>();
    area1.ShowGrid = true;
     
    CartesianGrid grid1 = area1.GetGrid<CartesianGrid>();
    grid1.DrawHorizontalFills = true;
    grid1.DrawVerticalFills = true;
    grid1.DrawHorizontalStripes = false;
    grid1.DrawVerticalStripes = false;
     
    area1.Grid.BackColor = Color.White;
    area1.Grid.BackColor2 = Color.White;
    area1.Grid.AlternatingBackColor = Color.White;
    area1.Grid.AlternatingBackColor2 = Color.White;

    In the attachments you can find an image demonstrating the appearance of RadChartVeiw. 

    Hope this will help you. Let me know if you have any other questions.

    Regards,
    Ralitsa
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready