Line series with multiple Y axis?

8 posts, 0 answers
  1. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 07 Mar 2011 Link to this post

    I have to design one line series with multiple y-axis. Also the no. of axis is not fixed. It may 2 or 3 or 5 y axis will be there.
    And i need to design it completely from code behind. Item source for the line series is in the form of List<T> object.
    The Following given is my Code.
    foreach (var t in e.Result.lstMeasureData)
              {
                  tempData.Add(new MeasureData { Datetaken = t.Datetaken, A1C = t.A1C, DBP = t.DBP, HDL = t.HDL, LDL = t.LDL, SBP = t.SBP, Weight = t.Weight });
              }
              SeriesMapping seriesMapping = new SeriesMapping();
              //seriesMapping.SeriesDefinition = new LineSeriesDefinition();
              //seriesMapping.ItemMappings.Add(new ItemMapping("Datetaken", DataPointMember.XCategory));
              //seriesMapping.ItemMappings.Add(new ItemMapping("Weight", DataPointMember.YValue));
              //seriesMapping.ItemMappings.Add(new ItemMapping("HDL", DataPointMember.YValue));
              //seriesMapping.ItemMappings.Add(new ItemMapping("LDL", DataPointMember.YValue));
              //seriesMapping.ItemMappings.Add(new ItemMapping("HDL", DataPointMember.YValue));
              //seriesMapping.SeriesDefinition.ShowItemLabels = false;
               
              ItemMapping i = new ItemMapping();
              i.FieldName = "Datetaken";
              i.DataPointMember = DataPointMember.XCategory;
              ItemMapping i1 = new ItemMapping();
              i1.FieldName = "Weight";
              i1.DataPointMember = DataPointMember.YValue;
              ItemMapping i2 = new ItemMapping();
              i2.FieldName = "SBP";
              i2.DataPointMember = DataPointMember.YValue;
     
     
              seriesMapping.ItemMappings.Add(i);
              seriesMapping.ItemMappings.Add(i1);
              seriesMapping.ItemMappings.Add(i2);
               
              radChart1.DefaultSeriesDefinition = new LineSeriesDefinition();
                           
              radChart1.DefaultSeriesDefinition.ShowItemLabels = false;
              radChart1.DefaultView.ChartArea.EnableAnimations = true;
              radChart1.DefaultView.ChartArea.EnableTransitionAnimations = true;
     
              radChart1.DefaultView.ChartArea.ZoomScrollSettingsX.RangeEnd = 1;
              radChart1.DefaultView.ChartArea.ZoomScrollSettingsX.MinZoomRange = 0.001;
              radChart1.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;
     
              radChart1.DefaultView.ChartArea.AxisY.Title = "Measures";
              radChart1.DefaultView.ChartArea.AxisX.Title = "Dates";
     
     
     
     
              radChart1.SeriesMappings.Add(seriesMapping);
     
              radChart1.ItemsSource = tempData;
  2. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 08 Mar 2011 Link to this post

    Admins answer this post as soon as possible.
  3. DevCraft banner
  4. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 11 Mar 2011 Link to this post

    Hi Rahul,

    You can do this through the AdditionalYAxes property. Here is a tutorial on this.

    Best wishes,
    Vladimir Milev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 11 Mar 2011 Link to this post

    Thanx for reply but i want something like this. Check out the attached image.
    Only difference i want is that i want that both right hand y-axis on left side.
  6. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 11 Mar 2011 Link to this post

    See the attached image for more information. Also I'm telling you bit about DataSource to the Chart.
    public class TrafficInfo
       {
           public DateTime Date { get; set; }
           public int Visits { get; set; }
           public int IMPVisits { get; set; }
           public int MissedVisits { get; set; }
       }
    I want to bind Date on X-Axis and Visits,IMPVisits and MissedVisits on Y-Axis.
    Each Line should have its own Y-Axis.
    Plz answer as soon as possible.
  7. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 17 Mar 2011 Link to this post

    Hello Rahul,

    Unfortunately this is currently not supported by RadChart. We apologize for the inconvenience.

    Greetings,
    Vladimir Milev
    the Telerik team
  8. Brian
    Brian avatar
    73 posts
    Member since:
    Sep 2010

    Posted 23 Sep 2011 Link to this post

    I would like to see this feature added in future versions.  The ability to choose which side (left or right) that you want your additional Y axis on is crucial for our development.
    Tks.
  9. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 25 Sep 2011 Link to this post

    Already Sia has given the solution for my problem in another thread. Check out the following link.

    http://www.telerik.com/community/forums/silverlight/chart/mutliple-y-axis-on-left-side-of-the-chart.aspx
Back to Top
DevCraft banner