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

Width of Bar Series

3 Answers 206 Views
Chart
This is a migrated thread and some comments may be shown as answers.
John Morris
Top achievements
Rank 1
John Morris asked on 19 Jan 2010, 08:21 PM
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?

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 22 Jan 2010, 10:03 AM
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.

Greetings,
Ves
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.
0
B
Top achievements
Rank 1
answered on 09 Jul 2013, 07:11 PM
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 });
        chartControl.SeriesMappings.Add(seriesMapping); 

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

Regards,
Bill
0
Ves
Telerik team
answered on 11 Jul 2013, 03:42 PM
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,
Ves
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
Tags
Chart
Asked by
John Morris
Top achievements
Rank 1
Answers by
Ves
Telerik team
B
Top achievements
Rank 1
Share this question
or