Setting backcolor, gradient, etc. in code

2 posts, 0 answers
  1. Joshua
    Joshua avatar
    1 posts
    Member since:
    Mar 2016

    Posted 23 Jun Link to this post

    I want to be able to set the backcolor for the chart itself with a gradient.  I can easily set the backcolor property but don't see away to control the gradient.  I see that in the property build under Edit UI Elements there is the RadChartElement.  Not sure how to get to that programmatically?  Please advise or let me know the correct way to accomplish this.

    Thanks

  2. Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 24 Jun Link to this post

    Hello Joshua,

    Thank you for writing.

    You can use the ChartElement properties to set a gradient background:
    radChartView1.ChartElement.GradientStyle = GradientStyles.Linear;
    radChartView1.ChartElement.NumberOfColors = 4;
    radChartView1.ChartElement.BackColor = Color.Red;
    radChartView1.ChartElement.BackColor2 = Color.Gray;
    radChartView1.ChartElement.BackColor3 = Color.Green;
    radChartView1.ChartElement.BackColor4 = Color.Blue;

    Let me know if I can assist you further.

    Regards,
    Dimitar
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top