How to sort dates with multiple series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

How to sort dates with multiple series

Post by Simon » Mon Jan 12, 2004 2:15 pm

Hello,
I have a webchart with 2 points series. The bottom values of the two series are DateTime from 2 different queries, but on the same table.

queries :
p1: "SELECT * from tablesechages where idsechoir = 1 order by timestampdebut";
p2:"SELECT * from tablesechages where idsechoir = 2 order by timestampdebut";

My problem is my the date range. I want, in the graphic, the first date at left and the last date at right. SORTED DATES. I am not able when I use multiple series.

I tried :

unpoint.XValues.DateTime = true;
unpoint2.XValues.DateTime = true;
unpoint.XValues.Sort();
unpoint.SortByLabels();
unpoint2.XValues.Sort();
unpoint2.SortByLabels();


Thanks,
Simon

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jan 14, 2004 11:43 am

Hi Simon,

I cannot reproduce the problem using the following code :

Code: Select all

		private void Page_Load(object sender, System.EventArgs e)
		{
			Random rnd = new Random();
			Steema.TeeChart.Chart chart1 = WebChart1.Chart;
			chart1.Aspect.View3D = false;
			chart1.Series.Add(new Steema.TeeChart.Styles.Points());
			chart1.Series.Add(new Steema.TeeChart.Styles.Points());
			for(int i = 12; i <= 31; ++i) 
			{
				string tempDate = i.ToString() + "/12/2003";
				chart1.Series[0].Add(DateTime.Parse(tempDate).ToOADate(),rnd.Next(100),Color.Red);
			}
			for(int i = 1; i <= 15; ++i) 
			{
				string tempDate = i.ToString() + "/12/2003";
				chart1.Series[1].Add(DateTime.Parse(tempDate).ToOADate(),rnd.Next(100),Color.Red);
			}
			chart1.Series[0].XValues.DateTime = true;
			chart1.Series[1].XValues.DateTime = true;
			chart1.Axes.Bottom.Labels.Angle = 90;
		}
Does the problem happens using something similar ?

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

Date sorting

Post by Simon » Mon Jan 19, 2004 3:45 pm

Hello,
I sorry for the delay. I tried your code, it works with random values, and it also works with Northwind database (sample values with sqlserver). BUT not for me...

I tried to set my datetime in varchar type. It's not the problem. I have two items : sechoir1 and sechoir2 (sechoir = dryer). When its the end date of sechoir1, some date of sechoir2 occurs. I don't really understand, but what I see is that the chart show the values for both, and after it only show the sechoir2 alone values. You can see the graphic :

Image

Any ideas?
thank you,
Simon

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jan 21, 2004 1:30 pm

Hi Simon,

I cannot see the image you've attached, could you please send it again to the steema.public.attachments newsgroup ?

> I tried to set my datetime in varchar type
Is the datefield currently 'Datetime' ? If not, please could you check results with the date as datetime or as double ?

Post Reply