Impoting a Text File for Tower series.
Impoting a Text File for Tower series.
2.0.2040.15118
Hi,
I have created a tower series, filled it with 50 sample values and exported it to Chart1.txt file from the Editor.
I then deleted the series and added a new tower series and set the datasource to a text file, (the one I just created).
I then hit Apply and it gives me the following:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
Am I missing something here, please can you give me an example of how I can import a text file?
Many thanks,
Vaughan
Hi,
I have created a tower series, filled it with 50 sample values and exported it to Chart1.txt file from the Editor.
I then deleted the series and added a new tower series and set the datasource to a text file, (the one I just created).
I then hit Apply and it gives me the following:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
Am I missing something here, please can you give me an example of how I can import a text file?
Many thanks,
Vaughan
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vaughan,
To import series data from a .txt file please have a look at the "All Features\Welcome !\Importing\Data\From text file" example at TeeChart features demo available at TeeChart's program group.
For the importing data that way it would may be more suitable for you to use an XML file. You'll find example on the features demo an tutorials.
To import series data from a .txt file please have a look at the "All Features\Welcome !\Importing\Data\From text file" example at TeeChart features demo available at TeeChart's program group.
For the importing data that way it would may be more suitable for you to use an XML file. You'll find example on the features demo an tutorials.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vaughan,
I've been able to reproduce the problem here and we've found there's a bug that when importing series data from a text file X,Y and Z values are not supported, just X and Y values are supported. I've added this (TF02011037) to our defect list to be fixed for future releases.
I've been able to reproduce the problem here and we've found there's a bug that when importing series data from a text file X,Y and Z values are not supported, just X and Y values are supported. I've added this (TF02011037) to our defect list to be fixed for future releases.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vaughan,
After further testing we have found that this is not a bug, it works fine using the code below:
Notice the differences for v1 and v2.
After further testing we have found that this is not a bug, it works fine using the code below:
Code: Select all
private void button1_Click(object sender, System.EventArgs e)
{
/* v2 *///Steema.TeeChart.Data.TextSource ts = new Steema.TeeChart.Data.TextSource("../../RXQULvsMSP.csv");
/* v1 */Steema.TeeChart.Data.TextSource ts = new Steema.TeeChart.Data.TextSource();
if(System.IO.File.Exists("../../RXQULvsMSP.csv"))
{
System.IO.File.Copy("../../RXQULvsMSP.csv", @"C:\temp\testnet2.txt", true);
tower1.Clear();
tower1.IrregularGrid=true;
textSource1.HeaderLines = 1;
textSource1.Separator = ',';
textSource1.Series = tower1;
textSource1.Fields.Add(1, "X");
textSource1.Fields.Add(2, "Y");
textSource1.Fields.Add(3, "Z");
/* v2 *///textSource1.LoadFromFile(@"C:\temp\testnet2.txt");
/* v1 */textSource1.FileName = @"C:\temp\testnet2.txt";
/* v1 */textSource1.RefreshData();
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vaughan,
No, using the editor works too. You may not be using it properly, could you should:
1) Set the fields to its column index starting at 0.
2) Not using any "Text" field.
3) Setting the number of header lines.
4) Setting the separator.
No, using the editor works too. You may not be using it properly, could you should:
1) Set the fields to its column index starting at 0.
2) Not using any "Text" field.
3) Setting the number of header lines.
4) Setting the separator.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I have tried the Editor and I have eventually got it to work for the file you specified. Still after many exceptions and application crashes...
...even if the end user enters the fields incorrectly int he Editor I still would not expect the application to crash!
However, using this same method it still does not accept the other file I sent to you MSPvsRXQUL.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Tower.DrawCell(Int32 x, Int32 z)
at Steema.TeeChart.Styles.Tower.DrawCells()
at Steema.TeeChart.Styles.Tower.Draw()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
...even if the end user enters the fields incorrectly int he Editor I still would not expect the application to crash!
However, using this same method it still does not accept the other file I sent to you MSPvsRXQUL.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Tower.DrawCell(Int32 x, Int32 z)
at Steema.TeeChart.Styles.Tower.DrawCells()
at Steema.TeeChart.Styles.Tower.Draw()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vaughan,
I've just sent to your e-mail address account the project I've used to load your files and which works here.
I've just sent to your e-mail address account the project I've used to load your files and which works here.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I have just tried the sample project you sent to me.
Indeed for the first time, it does load in this file
However, if you attempt to change the series to a surface and then back to tower it still gives the same error.
I have also noticed in your project that you set the following:
tower1.IrregularGrid=true;
Without this line, Teechart fails to load the file.
Indeed for the first time, it does load in this file
However, if you attempt to change the series to a surface and then back to tower it still gives the same error.
I have also noticed in your project that you set the following:
tower1.IrregularGrid=true;
Without this line, Teechart fails to load the file.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vaughan,
Yes, this leads to the issue you reported in this thread, where I've posted a workaround.
Yes, this leads to the issue you reported in this thread, where I've posted a workaround.
Yes, this is important for those series types. IrregularGrid determines if X and Z values are equi-distant or not.I have also noticed in your project that you set the following:
tower1.IrregularGrid=true;
Without this line, Teechart fails to load the file.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |