Width of Bar Series

4 posts, 0 answers
  1. John Morris
    John Morris avatar
    28 posts
    Member since:
    Aug 2009

    Posted 19 Jan 2010 Link to this post

    I can't seem to change the default width of my bars in a bar series.  I've set my AxisX LayoutMode to "Between", however you can see in my example (see attached), they remain far too thin.  I would like them to fill the space between each axis or at least be a little wider than they are now.  Is there a width property somewhere for the bars?
  2. Ves
    Ves avatar
    2869 posts

    Posted 22 Jan 2010 Link to this post

    Hello John,

    It seems you have multiple series with one item in each of them. In addition the items have their XValue set, so that every item appears at its own position along X axis. In this case RadChart allocates enough space for all series in each X axis item i.e. it  should be possible to have items from each series in the same X position.

    In this case I would suggest using a single DataSeries with LegendDisplayMode set to LegendDisplayMode.DataPointLabel. This way the items will appear with different colors (according to the series palette) and there will be a legend item available for every bar.

    I have attached a small example with two charts - the first one has several series and reproduces the thin bars (not sure if this matches your scenario exactly) while the second one is populated with the same data source, but there is a single DataSeries.

    Hope this helps.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
  4. B
    B avatar
    1 posts
    Member since:
    Jun 2013

    Posted 09 Jul 2013 Link to this post

    Hi Ves,
    I actually had the same problem as John but I did not quite understand your solution.  I am using RadChart SeriesMapping to generate aggregation charts from a DataTable.  However, the generated chart automatically comes up as being oddly positioned as in John's image. This is the code-behind that generates the seriesMapping.

    seriesMapping.SeriesDefinition = new BarSeriesDefinition();
            seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor(groupField.FieldIDinQuery));
            seriesMapping.ItemMappings.Add(new ItemMapping(agField.FieldIDinQuery, DataPointMember.YValue, aggregate) { FieldType = agField.DataType });
            seriesMapping.ItemMappings.Add(new ItemMapping(groupField.FieldIDinQuery, DataPointMember.XCategory) { FieldType = groupField.DataType });

    I'm not sure how I would combine it into one dataSeries. I just want the bars to fit more naturally.  Thanks.

  5. Ves
    Ves avatar
    2869 posts

    Posted 11 Jul 2013 Link to this post

    Hi Bill,

    It is the ChartGroupDescriptor that forces the chart to generate multiple series, which in turn cases the bars to appear with decreased width and with odd positioning. I am not sure about the data being sent to the chart, but if you get a chart like John's (i.e. one bar per category, but narrow and displaced) then removing the line that adds the ChartGroupDescriptor should fix it for you.

    Best regards,
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top