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

Setting backcolor, gradient, etc. in code

1 Answer 207 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 23 Jun 2016, 08:26 PM

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

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 24 Jun 2016, 06:42 AM
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.
Tags
ChartView
Asked by
Joshua
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or