This question is locked. New answers and comments are not allowed.
I am trying to create a RadChart that has a line series for each collection contained in a dictionary. I have looked at the "Binding to Nested Collections" example and tried setting the CollectionIndex of the SeriesMapping to the integer key used by dictionary but I get an ArgumentOutOfRange exception when I set the charts Itemsource. I also tried just setting it to 0 when there is a single collection in the dictionary but no change.
This is what I am trying to bind to:
This is the code that adds the series. tagId is a key into the dictionary.
Can someone tell me what I am doing wrong? I'm still a trial user and would like to make sure that this works before I purchase the controls. Thanks.
This is what I am trying to bind to:
public Dictionary<int, ObservableCollection<PubSubServiceProxy.TimestampedDouble>> Data { get; set; }This is the code that adds the series. tagId is a key into the dictionary.
void AddSeries(string name, int tagId){ try { var seriesMapping = new SeriesMapping(); seriesMapping.SeriesDefinition = new LineSeriesDefinition(); seriesMapping.SeriesDefinition.SeriesName = name; seriesMapping.SeriesDefinition.ShowItemLabels = false; seriesMapping.SeriesDefinition.ShowItemToolTips = false; seriesMapping.ItemMappings.Add(new ItemMapping("Timestamp", DataPointMember.XValue)); seriesMapping.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue)); seriesMapping.CollectionIndex = tagId; chart.SeriesMappings.Add(seriesMapping); chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "mm:ss.fff"; chart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45; chart.ItemsSource = _viewModel.Data; } catch (Exception ex) { throw; }}Can someone tell me what I am doing wrong? I'm still a trial user and would like to make sure that this works before I purchase the controls. Thanks.