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

Pattern fills?

1 Answer 69 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 06 May 2016, 07:14 PM
I would like to do pattern fills in chart series bars rather than just colors. I gather that this is something that could probably be done with custom rendering but I was hoping you might have thought about this and have some sample code that you could show rather than me trying to reinvent the wheel.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 09 May 2016, 12:49 PM
Hello Steve,

Thank you for writing.

By default, the bar fill supports a 4 color gradient, for example, you can set it like this:
private void radButton1_Click(object sender, EventArgs e)
{
    foreach (BarPointElement item in radChartView1.Series[0].Children)
    {
        item.NumberOfColors = 4;
        item.GradientStyle = Telerik.WinControls.GradientStyles.Linear;
        item.BackColor = Color.Red;
        item.BackColor2 = Color.Green;
        item.BackColor3 = Color.Blue;
        item.BackColor4 = Color.Black;
    }
}

If this is not sufficient for your case, you will need to use the custom rendering and manually paint the fill. 

I hope this will be useful.

Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ChartView
Asked by
Steve
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or