LineSeriesDefinition does not "connect the dots" when using Groupings

5 posts, 0 answers
  1. Tim
    Tim avatar
    85 posts
    Member since:
    Aug 2008

    Posted 15 Apr 2010 Link to this post

    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.
  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 19 Apr 2010 Link to this post

    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.
  3. DevCraft banner
  4. Tim
    Tim avatar
    85 posts
    Member since:
    Aug 2008

    Posted 19 Apr 2010 Link to this post

    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.
  5. Dhaval
    Dhaval avatar
    17 posts
    Member since:
    Feb 2011

    Posted 10 Feb 2011 Link to this post

    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
  6. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 15 Feb 2011 Link to this post

    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>>
Back to Top
DevCraft banner