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

Chart Displays "No Data Series"

1 Answer 167 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 02 May 2011, 10:30 PM
Hi,

I have created a chart to display time series data in my project.  I have it arranged as a RadChart and RadTimeBar control.  The TimeBar contains a sparkline to show the overall data trend, while the chart is supposed to display the details.

My problem is with the chart.  The timebar displays the data just fine, but the chart seems stuck on a single value, which seems to be related to the window selected in the time bar.  I have no idea why this is not working properly.  Please help!

Please see screen shot and code:

Thanks

<telerik:RadChart Name="radChart1" Grid.Row="0">
    <telerik:RadChart.TimeBar>
        <Binding ElementName="radTimeBar1" />
    </telerik:RadChart.TimeBar>
</telerik:RadChart>


private void AddPointToChart(PointSeriesContainer pointSeries)
{
    if (radChart1.SeriesMappings.Count == 0)
        AddSparklineToTimeBar(pointSeries);
    var seriesMap = CreateSeriesMapping(pointSeries);
    radChart1.SeriesMappings.Add(seriesMap);
}       
 
private static SeriesMapping CreateSeriesMapping(PointSeriesContainer pointSeries)
{
    SeriesMapping seriesMapping = new SeriesMapping();
 
    seriesMapping.ItemsSource = pointSeries.TransformedSamples;
    seriesMapping.LegendLabel = pointSeries.Point.Name;
    seriesMapping.SeriesDefinition = new LineSeriesDefinition { ShowItemToolTips = true };
 
    ItemMapping xMapping = new ItemMapping("SampleTime", DataPointMember.XValue);
    ItemMapping yMapping = new ItemMapping("PointValue", DataPointMember.YValue) { AggregateFunction = ChartAggregateFunction.Sum };
    ItemMapping toolMapping = new ItemMapping("PointValue", DataPointMember.Tooltip);
 
    seriesMapping.ItemMappings.Add(xMapping);
    seriesMapping.ItemMappings.Add(yMapping);
    seriesMapping.ItemMappings.Add(toolMapping);
 
    return seriesMapping;
}



1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 05 May 2011, 01:06 PM
Hello Rob,

It is hard for us to determine the cause of the issue from the code snippets provided. Have you seen our demo as it does exactly what you want to achieve? If the issue still occurs it will be very helpful if you can send us a sample runnable project so that we can investigate it and help you.

Best wishes,
Evgenia
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
Rob
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or