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

LineSeriesDefinition does not "connect the dots" when using Groupings

4 Answers 105 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 15 Apr 2010, 08:12 AM
I am putting a chart together that uses both Aggregation/Grouping and NestedCollections.  I am basically binding 2 ObservableCollections (bound to the ItemsSource via a List<ObservableCollection<T>>).  There are 2 SeriesMappings, 1 bar and 1 line.  The data displays just fine, however, the "dots" generated for the LineSeries does not connect with lines.

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Apr 2010, 12:10 PM
Hi Tim,

The dots of the Line series do not connect because they are from different series, evident by the different colors of their labels. So effectively, there are 4 data series with one data point in each of them - hence the pointmarks you see are not connected with lines. This is also true for the bars - 4 series with one bar in each series.

In this case you may prefer not to group the chart items, so that you get only two series - one for the bars and one for the line. This way you will also avoid the relatively narrow bars -- you can see there is plenty of room for them. The reason is again in the  different series the bars belong to - there is enough room to display 4 bars at each position along the X axis as there are 4 series.

Finally, not grouping the items in the chart would lead to 4 bars with the same color -- you can get them with individual colors by setting the SeriesDefinition's LegendDisplayMode to Legend.DisplayMode.DataPointLabel as done in this example.

Should other questions arise, please, do not hesitate to contact us.

Sincerely yours,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Tim
Top achievements
Rank 1
answered on 19 Apr 2010, 09:49 PM
Hi, thanks for responding.  I finally figured out the issue.  I was only grouping on one field from my data and just needed to add a 2nd grouping and set "ShouldCreateSeriesForLastGroup=false".  Now the legend and data points connect correctly.
0
Dhaval
Top achievements
Rank 1
answered on 10 Feb 2011, 04:07 PM
I have same problem
i posted on telerik just check out

http://www.telerik.com/community/forums/silverlight/chart/line-chart-with-groping-seriesmapping-groupingsettings-groupdescriptors.aspx

if is it possible to help me

Thanks
0
Nikolay
Telerik team
answered on 15 Feb 2011, 09:20 AM
Hello Dhaval,

The dots in your sample are not connected because they are from two different Line series, with one point each. You can achieve the desired behavior by creating one Line series with two points and use the LegendDisplayMode property, instead of grouping. Please, note that you would also need a numeric value for the mapping to DataPointMember.YValue. Here is a sample code snippet, which would hopefully be useful for you :
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new LineSeriesDefinition();
seriesMapping.ItemMappings.Add(new ItemMapping("Stage", DataPointMember.XCategory));
seriesMapping.ItemMappings.Add(new ItemMapping("Score", DataPointMember.YValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Stage", DataPointMember.LegendLabel));
seriesMapping.SeriesDefinition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;
RadChart1.SeriesMappings.Add(seriesMapping);

For more information on grouping, please, have a look at this help topic.

Best wishes,
Nikolay
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Chart
Asked by
Tim
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Tim
Top achievements
Rank 1
Dhaval
Top achievements
Rank 1
Share this question
or