Pattern fills?

2 posts, 0 answers
  1. Steve
    Steve avatar
    43 posts
    Member since:
    May 2014

    Posted 06 May Link to this post

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

    Posted 09 May Link to this post

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