Correct Date Time display on X axis & Graph orientation
Posted: Mon Aug 16, 2004 8:33 am
Hello, using TeeChart for Visual Studio, with .NET in C# i am having a couple of problems developing my program for the pocket PC 2003:
1. I have set my x series to date time values, and the x axis is set as date time values. The data is constantly added to the graph dynamically with a double y value and the x value is a date time (ie. DateTime.Now). The problem is that my values roll across the graph correctly in the corrrect date time increment, but the labels on the graph only ever show "01/01/01 12:00" all the time over and over again, is this a bug, or am i forgetting something?
2. working with the pocket pc, space is a premium so i have my graph placed on a tab page taking up the entire screen (246 x 302), but i want to make use of this space by the graph being displyed landscape as oposed to portrait, is there any way to do this?
Here is my code regarding the the graph:
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage1.Location = new System.Drawing.Point(0, 0);
this.tabPage1.Size = new System.Drawing.Size(246, 302);
this.tChart1 = new TChart();
this.tChart1.Bounds = new Rectangle(0,0,246,278);
this.tChart1.Parent = this.tabPage2;
//this.tChart1. - need to change from portrait to landscape:
this.tChart1.Legend.Visible = false;
this.tChart1.Aspect.View3D = false;
this.tChart1.Axes.Left.Automatic = false;
this.tChart1.Axes.Left.Minimum = 0.0;
this.tChart1.Axes.Left.Maximum = 10.0;
this.tChart1.Axes.Bottom.Automatic = true;
this.tChart1.Axes.Bottom.Minimum = Steema.TeeChart.Utils.DateTime(DateTime.Now);
this.tChart1.Axes.Bottom.Labels.OnAxis = false;
this.tChart1.Axes.Bottom.Increment =
Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.TenSeconds];
this.tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy hh:mm:ss";
this.tChart1.Axes.Bottom.Labels.ExactDateTime = true;
this.tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
//add the series to the graph:
this.lineSeriesArray = new Steema.TeeChart.Styles.FastLine();
this.lineSeriesArray.ColorEach = false;
this.lineSeriesArray.Title = nodeListParam.Attributes.Item(0).InnerText;//first item is name
this.lineSeriesArray.XValues.DateTime = true;
this.lineSeriesArray.DrawAllPoints = false;
this.lineSeriesArray.AutoRepaint = false;
this.tChart1.Series.Add(this.lineSeriesArray);
this.lineSeriesArray.Clear();
Any help for these 2 problems would be grately appriciated,
Matthew
1. I have set my x series to date time values, and the x axis is set as date time values. The data is constantly added to the graph dynamically with a double y value and the x value is a date time (ie. DateTime.Now). The problem is that my values roll across the graph correctly in the corrrect date time increment, but the labels on the graph only ever show "01/01/01 12:00" all the time over and over again, is this a bug, or am i forgetting something?
2. working with the pocket pc, space is a premium so i have my graph placed on a tab page taking up the entire screen (246 x 302), but i want to make use of this space by the graph being displyed landscape as oposed to portrait, is there any way to do this?
Here is my code regarding the the graph:
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage1.Location = new System.Drawing.Point(0, 0);
this.tabPage1.Size = new System.Drawing.Size(246, 302);
this.tChart1 = new TChart();
this.tChart1.Bounds = new Rectangle(0,0,246,278);
this.tChart1.Parent = this.tabPage2;
//this.tChart1. - need to change from portrait to landscape:
this.tChart1.Legend.Visible = false;
this.tChart1.Aspect.View3D = false;
this.tChart1.Axes.Left.Automatic = false;
this.tChart1.Axes.Left.Minimum = 0.0;
this.tChart1.Axes.Left.Maximum = 10.0;
this.tChart1.Axes.Bottom.Automatic = true;
this.tChart1.Axes.Bottom.Minimum = Steema.TeeChart.Utils.DateTime(DateTime.Now);
this.tChart1.Axes.Bottom.Labels.OnAxis = false;
this.tChart1.Axes.Bottom.Increment =
Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.TenSeconds];
this.tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy hh:mm:ss";
this.tChart1.Axes.Bottom.Labels.ExactDateTime = true;
this.tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
//add the series to the graph:
this.lineSeriesArray = new Steema.TeeChart.Styles.FastLine();
this.lineSeriesArray.ColorEach = false;
this.lineSeriesArray.Title = nodeListParam.Attributes.Item(0).InnerText;//first item is name
this.lineSeriesArray.XValues.DateTime = true;
this.lineSeriesArray.DrawAllPoints = false;
this.lineSeriesArray.AutoRepaint = false;
this.tChart1.Series.Add(this.lineSeriesArray);
this.lineSeriesArray.Clear();
Any help for these 2 problems would be grately appriciated,
Matthew