Can we set different width in each of BarChart series

3 posts, 0 answers
  1. Andy
    Andy avatar
    10 posts
    Member since:
    Feb 2012

    Posted 08 Feb 2012 Link to this post

    Dear Telerik Team,

    We are currently trying to display a bar chart which has different width for its series by using radchart (see attachment) 
    Is it possible? 

  2. Andy
    Andy avatar
    10 posts
    Member since:
    Feb 2012

    Posted 09 Feb 2012 Link to this post

    I found the way to have different width for each bar series :

                    radChart1.SeriesMappings[0].SeriesDefinition.ItemStyle = new Style();
                    radChart1.SeriesMappings[0].SeriesDefinition.ItemStyle.Setters.Add(new Setter(Shape.WidthProperty, Double.Parse("50")));
                    radChart1.SeriesMappings[1].SeriesDefinition.ItemStyle = new Style();
                    radChart1.SeriesMappings[1].SeriesDefinition.ItemStyle.Setters.Add(new Setter(Shape.WidthProperty, Double.Parse("80")));

    But the result is not right. there is a gap between each series. (attached screenshot)
    Is there any way to make it stacked?

  3. Nikolay
    Nikolay avatar
    395 posts

    Posted 13 Feb 2012 Link to this post

    Hi Andy,

    Unfortunately such a feature is not supported by the current version of the control as by definition each bar in a Bar series should be of equal width. The gaps appear because the space for each bar along the X axis is calculated as per the widest one, which is also why the 3rd and 4th bars slightly overlap as well.

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top