Correct Date Time display on X axis & Graph orientation
Correct Date Time display on X axis & Graph orientation
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
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Matthew,
No, this appears to be a bug. I have added the issue to the list of defects meaning that the issue will be studied before the next maintenance release.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?
Mmm .. you could try using the Horiz Line or Horiz bar series.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?
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
OK, for the first point if its a bug, then fair enough theres nothing we can do. In the second case, if the only way to change the orientation of the graph is say horizontal line series, then i would require a method that allows me to plot dateTime values on the Y axis and double values on the X axis. The current add method has no overload with these parameters, and this may be a design issue for a future release as i am sure there will be others requiring landscape graphs, especially for Pocket PC's.
Could you inform me when the next updated version is released please, or if you come across a solution in the meantime let me know asap,
Matthew
Could you inform me when the next updated version is released please, or if you come across a solution in the meantime let me know asap,
Matthew
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Matthew,
You can plot datetime values on the YAxis .. set the DateTime property for this valuelist to true (see Steema.TeeChart.Styles.ValueList.DateTime Property) and then use the DateTime.ToOADate() method (see http://msdn.microsoft.com/library/defau ... etopic.asp).In the second case, if the only way to change the orientation of the graph is say horizontal line series, then i would require a method that allows me to plot dateTime values on the Y axis and double values on the X axis. The current add method has no overload with these parameters, and this may be a design issue for a future release as i am sure there will be others requiring landscape graphs, especially for Pocket PC's.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Thanks for your speedy reply Chris, but I have realised some things from then. I am already plotting using the equivalent of a horizontal Line series. When the PDA is turned on it side I will get vertical lines coming up from the y-axis.
I ultimately need to plot vertical lines (not bar charts) coming from the x-axis at the bottom, and against the y-axis on the right, with the origin in the bottom right corner. The y values need to be DateTime values and x values need to be double values increasing right to left.
I can find no vertical line series, so any ideas would be most helpful, could the customPoint series be used?
Matthew
P.S. The link in your last post was broken and led to a non-existent page.
I ultimately need to plot vertical lines (not bar charts) coming from the x-axis at the bottom, and against the y-axis on the right, with the origin in the bottom right corner. The y values need to be DateTime values and x values need to be double values increasing right to left.
I can find no vertical line series, so any ideas would be most helpful, could the customPoint series be used?
Matthew
P.S. The link in your last post was broken and led to a non-existent page.
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Matthew,
OK. Is this when the PDA is vertical or when it is rotated anti-clockwise 90º?I ultimately need to plot vertical lines (not bar charts) coming from the x-axis at the bottom, and against the y-axis on the right, with the origin in the bottom right corner. The y values need to be DateTime values and x values need to be double values increasing right to left.
The link in my last post is functional. What's happened is that the closing bracket and full stop have been included into the link by the web forum's parser.P.S. The link in your last post was broken and led to a non-existent page.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Matthew,
Something like this:This is when the PDA is vertical, so when its turned on its side (rotate 90 clockwise) it looks like a normal line series, with values being added left to right.
Code: Select all
Steema.TeeChart.Styles.HorizLine horizLine1 = new Steema.TeeChart.Styles.HorizLine(tChart1.Chart);
tChart1.Axes.Bottom.Inverted = true;
tChart1.Axes.Right.Labels.Angle = 90;
tChart1.Axes.Bottom.Labels.Angle = 90;
tChart1.Legend.Visible = false;
tChart1.Header.Visible = false;
tChart1.Aspect.View3D = false;
horizLine1.FillSampleValues(10);
horizLine1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Thankyou very much chris, I now have 1 series working. The only problem is that changing the label's angle properties seem to have no effect, no matter what value I change them to? Is this another bug, or do i need to do something else?
this.tChart2.Axes.Bottom.Labels.Angle = 270;
this.tChart2.Axes.Right.Labels.Angle = 270;
Matthew
this.tChart2.Axes.Bottom.Labels.Angle = 270;
this.tChart2.Axes.Right.Labels.Angle = 270;
Matthew
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Matthew,
Mmm, have you tried testing the code in a normal WinForm? It works there. At this precise moment in time I cannot confirm if this code works with TeeChart.Pocket.dll.Thankyou very much chris, I now have 1 series working. The only problem is that changing the label's angle properties seem to have no effect, no matter what value I change them to?
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi ---
OK, I've been able to confirm this issue and have added it to our list of defects, meaning that a fix to it will be considered for inclusion into the next maintenance release.Yes, it seems to work fine in the normal libary, as it must do for you there, but unfortunately it has no effect using the pocket libary for the pda/pocket pc. This may be another bug you may need to look into for the next maintence release!
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/