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

Line series with multiple Y axis?

7 Answers 145 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 2
Rahul asked on 08 Mar 2011, 05:51 AM
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;

7 Answers, 1 is accepted

Sort by
0
Rahul
Top achievements
Rank 2
answered on 08 Mar 2011, 09:47 AM
Admins answer this post as soon as possible.
0
Vladimir Milev
Telerik team
answered on 11 Mar 2011, 09:08 AM
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!
0
Rahul
Top achievements
Rank 2
answered on 11 Mar 2011, 10:27 AM
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.
0
Rahul
Top achievements
Rank 2
answered on 11 Mar 2011, 10:57 AM
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.
0
Vladimir Milev
Telerik team
answered on 17 Mar 2011, 09:01 AM
Hello Rahul,

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

Greetings,
Vladimir Milev
the Telerik team
0
Brian
Top achievements
Rank 1
answered on 23 Sep 2011, 06:28 PM
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.
0
Rahul
Top achievements
Rank 2
answered on 25 Sep 2011, 11:52 AM
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
Tags
Chart
Asked by
Rahul
Top achievements
Rank 2
Answers by
Rahul
Top achievements
Rank 2
Vladimir Milev
Telerik team
Brian
Top achievements
Rank 1
Share this question
or