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

No method 'Average' on type 'System.Linq.Enumerable' is compatible with the supplied arguments.

3 Answers 105 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Luis Mejia
Top achievements
Rank 1
Luis Mejia asked on 30 Apr 2010, 05:48 AM
Hi,

I'm testing out this library and I'm getting the following error:
No method 'Average' on type 'System.Linq.Enumerable' is compatible with the supplied arguments.

I'm doing a very simple test. Here is the relevant code:

public class Data     
{     
    public UInt32 XValue { getset; }     
    public double YValue { getset; }     
}     
    
List<Data> m_Data; // This is initialized with data.     
    
// Then, when setting up the chart...     
    
SeriesMapping seriesMapping = new SeriesMapping();     
LineSeriesDefinition lineDefinition = new LineSeriesDefinition();     
lineDefinition.ShowItemLabels = false;     
seriesMapping.SeriesDefinition = lineDefinition;     
seriesMapping.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));  
seriesMapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));     
MyChart.SeriesMappings.Add(seriesMapping);     
    
// Then I set my data     
MyChart.ItemSource = m_Data; 

When m_Data has more then 397 elements it throws that error. Before that number it looks pretty.

Any help will be greatly appreciated.
- Luis

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 04 May 2010, 02:00 PM
Hello Luis Mejia,

Thank you for notifying us. It seems the issue is caused by the UInt32 type of the Data.XValue member. The issue is not observed when using int or long. If possible, please switch to int or long for the time being. I have notified our developers, so they will investigate the issue and provide a fix for the next version of the control.

Alternatively, you may disable the sampling in RadChart.

I have updated your Telerik points.

Best regards,
Ves
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
Marcelo
Top achievements
Rank 1
answered on 06 Jul 2010, 06:51 PM
Hi,

I'm having the same issue but my XValues are of type datetime. To avoid this error I've tried changing the xvalues to string needed to revert back as the charts are way too slow to be updated (~ 600 points per series, 4 series per chart, 4 charts at the same time). Therefore I still don't have a solution for this issue.

Regards,

Marcelo
0
Ves
Telerik team
answered on 09 Jul 2010, 08:51 AM
Hello Marcelo,

Please, find attached a small example.

Best regards,
Ves
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
Tags
Chart
Asked by
Luis Mejia
Top achievements
Rank 1
Answers by
Ves
Telerik team
Marcelo
Top achievements
Rank 1
Share this question
or