Help with data binding and seriesmapping for a chart

1 posts, 0 answers
  1. JAS J
    JAS J avatar
    39 posts
    Member since:
    May 2010

    Posted 06 Oct 2011 Link to this post

    >> Update:
    The problem was that I was creating a new ChartArea everytime.


    Hi needed some help getting my chart to show up.  I cant seem to figure out where the error is. Can anyone see the error? what am I missing

    Here is what I have :

    ChartData is a List<DataSeries>
    A DataSeries is a List<DataPOints>

    A DataPoint is:

        int YValue
        DateTime XValue
        double XValueOA (the OA version of the XValue above);






    <telerik:RadChart ItemsSource="{Binding ChartData}" SeriesMappings="{Binding ChartSeriesMapping}">

      <telerik:ChartDefaultView ChartLegendPosition="Right">
        <telerik:ChartArea LegendName="ChartLegend1" EnableAnimations="False" >

    Once I have the data, and I can see that the data is good, I do the following to bind the data:
    I first set the ChartData

    ChartData = NewData; // I verified that the data looks fine
    int seriesIndex = 0;
    foreach ( string client in Clients)
     SeriesMapping mapping = new SeriesMapping();
     ItemMapping itemMappingXValue = new ItemMapping
     {  FieldName = "XValue", DataPointMember = DataPointMember.XValue  };
     ItemMapping itemMappingYValue = new ItemMapping
     {  FieldName = "YValue", DataPointMember = DataPointMember.YValue };// I have tried the OA value as well
     SeriesDefinition definition = new LineSeriesDefinition() {ShowItemLabels = false, SeriesName = client,
      Visibility = SeriesVisibility.Visible};
     mapping.ChartArea = new ChartArea { AxisX = { IsDateTime = true, AutoRange = true } };
     mapping.CollectionIndex = seriesIndex++;
     mapping.SeriesDefinition = definition;


    Unfortunately the chart never shows up. It disaplays  "No Data Series"

    Can anyone see what i might be doing wrong?


Back to Top