Using predefined images as fill for bar charts

3 posts, 0 answers
  1. Robert
    Robert avatar
    2 posts
    Member since:
    Aug 2011

    Posted 17 Sep 2014 Link to this post

    While using the now obsolete ChartView I was able to use custom image files in .png format, (similar, but different from the currently offered GradientStyles) as a filler for my bars in BarCharts. I used:


    which had several useful Properties.

    What would be the corresponding code using RadChartView to use these same images?

  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    3954 posts

    Posted 22 Sep 2014 Link to this post

    Hello Robert,

    Thank you for writing.

    Please have a look at the following code snippet, demonstrating how to assign an image to the elements in the BarSeries :
    public Form1()
        BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
        barSeries.Name = "Q1";
        barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(111, "Jones"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(118, "Marshall"));
        BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
        barSeries2.Name = "Q2";
        barSeries2.DataPoints.Add(new CategoricalDataPoint(153, "Harley"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(141, "White"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(130, "Smith"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(88, "Jones"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(109, "Marshall"));
    private void Form1_Load(object sender, EventArgs e)
        foreach (UIChartElement element in this.radChartView1.Series[0].Children)
            RadImageShape imageShape = new RadImageShape();
            imageShape.Image = Properties.Resources._2;
            element.BackColor = Color.Transparent;
            element.BackgroundShape = imageShape;

    I hope this information helps. Should you have further questions, I would be glad to help.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. Robert
    Robert avatar
    2 posts
    Member since:
    Aug 2011

    Posted 22 Sep 2014 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Yes! thank you, that works very well. I'll check out UIChartElements and RadImageShape for more features.

Back to Top