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
How to sort dates with multiple series
Hi Simon,
I cannot reproduce the problem using the following code :
Does the problem happens using something similar ?
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;
}
Pep Jorge
http://support.steema.com
http://support.steema.com
Date sorting
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 :
Any ideas?
thank you,
Simon
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 :
Any ideas?
thank you,
Simon
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 ?
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 ?
Pep Jorge
http://support.steema.com
http://support.steema.com