Hello,I want to binding XamTimeLine at code.There is my code:public class PelnasXamTimeLine{ public DateTime Time { get; set; } public string Title { get; set; } public string Details { get; set; } public int Duration { get; set; }}
In XAML:<ig:XamTimeline x:Name="Timeline" Margin="20,97,20,20" Background="{x:Null}"> <ig:XamTimeline.Axis> <ig:DateTimeAxis ScrollPosition="0.55" ScrollScale=".45" /> </ig:XamTimeline.Axis></ig:XamTimeline>
In code:DataTable table = new DataTable(e.Result);List<PelnasXamTimeLine> list = new List<PelnasXamTimeLine>();foreach (DataRow dr in table.Rows){ list.Add(new PelnasXamTimeLine { Details = "Aprasymas", Title = dr ["Preke"].ToString(), Time = Convert.ToDateTime(dr["Data"].ToString()), Duration = 50 });}Infragistics.Controls.Timelines.NumericTimeSeries series = new Infragistics.Controls.Timelines.NumericTimeSeries();
series.Title =
"Pelnas per pasirinkta laikotarpi";series.DataSource = list;series.DataMapping = "Time=Time;Duration=Duration;Title=Title;Details=Details";
//series.DataBind();
this.Timeline.Series.Add(series);
And the rersult is:
Can anyone help me?
Try creating DateTimeSeries instead of NumericTimeSeries. When you are using DateTime values - you need to use DateTimeAxis and DateTimeSeries.