This question is locked. New answers and comments are not allowed.
Graph shows No Data Series:
<telerik:RadChart x:Name="radOASHistory" Grid.Row="1" Margin="0,0,0,0" UseLayoutRounding="True" BorderThickness="0"
VerticalAlignment="Top" VerticalContentAlignment="Stretch" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch"
Height="500" Width="1300" MinHeight="300" MinWidth="700" MaxHeight="700" MaxWidth="1300"
>
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea>
<telerik:ChartArea.AxisX>
<telerik:AxisX AutoRange="True" />
</telerik:ChartArea.AxisX>
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="OAS [bp/yr]" AxisLabelsVisibility="Collapsed" />
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AdditionalYAxes>
<telerik:AxisY AutoRange="True"/>
</telerik:ChartArea.AdditionalYAxes>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" />
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
public void ProcessChart(ObservableCollection<PcyaSimServiceReference.PCYAsimServiceHistoryItem> results)
{
if (results == null)
return;
_data = results;
radOASHistory.SeriesMappings.Clear();
radOASHistory.DefaultView.ChartArea.DataSeries.Clear();
foreach (PcyaSimServiceReference.PCYAsimServiceHistoryItem hi in results)
{
DataSeries lineSeries = new DataSeries();
lineSeries.Definition = new LineSeriesDefinition { ShowItemLabels = false, ShowPointMarks = false };
foreach (CorporateBondCalculator.PcyaSimServiceReference.PCYAsimServiceHistoryRung item in hi.OAS)
{
lineSeries.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = item.Value, XValue = item.PriceDate.ToOADate() });
}
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = hi.Description;
seriesMapping.SeriesDefinition = lineSeries.Definition;
seriesMapping.ItemMappings.Add(new ItemMapping("PriceDate", DataPointMember.XValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Label", DataPointMember.Label));
radOASHistory.SeriesMappings.Add(seriesMapping);
radOASHistory.DefaultView.ChartArea.AxisX.IsDateTime = true;
radOASHistory.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
radOASHistory.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "MM/dd/yyyy";
radOASHistory.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
radOASHistory.DefaultView.ChartArea.DataSeries.Add(lineSeries);
}
<telerik:RadChart x:Name="radOASHistory" Grid.Row="1" Margin="0,0,0,0" UseLayoutRounding="True" BorderThickness="0"
VerticalAlignment="Top" VerticalContentAlignment="Stretch" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch"
Height="500" Width="1300" MinHeight="300" MinWidth="700" MaxHeight="700" MaxWidth="1300"
>
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea>
<telerik:ChartArea.AxisX>
<telerik:AxisX AutoRange="True" />
</telerik:ChartArea.AxisX>
<telerik:ChartArea.AxisY>
<telerik:AxisY Title="OAS [bp/yr]" AxisLabelsVisibility="Collapsed" />
</telerik:ChartArea.AxisY>
<telerik:ChartArea.AdditionalYAxes>
<telerik:AxisY AutoRange="True"/>
</telerik:ChartArea.AdditionalYAxes>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" />
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping DataPointMember="YValue" />
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
public void ProcessChart(ObservableCollection<PcyaSimServiceReference.PCYAsimServiceHistoryItem> results)
{
if (results == null)
return;
_data = results;
radOASHistory.SeriesMappings.Clear();
radOASHistory.DefaultView.ChartArea.DataSeries.Clear();
foreach (PcyaSimServiceReference.PCYAsimServiceHistoryItem hi in results)
{
DataSeries lineSeries = new DataSeries();
lineSeries.Definition = new LineSeriesDefinition { ShowItemLabels = false, ShowPointMarks = false };
foreach (CorporateBondCalculator.PcyaSimServiceReference.PCYAsimServiceHistoryRung item in hi.OAS)
{
lineSeries.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = item.Value, XValue = item.PriceDate.ToOADate() });
}
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = hi.Description;
seriesMapping.SeriesDefinition = lineSeries.Definition;
seriesMapping.ItemMappings.Add(new ItemMapping("PriceDate", DataPointMember.XValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Label", DataPointMember.Label));
radOASHistory.SeriesMappings.Add(seriesMapping);
radOASHistory.DefaultView.ChartArea.AxisX.IsDateTime = true;
radOASHistory.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
radOASHistory.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "MM/dd/yyyy";
radOASHistory.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
radOASHistory.DefaultView.ChartArea.DataSeries.Add(lineSeries);
}