Import and Export

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
history
Newbie
Newbie
Posts: 29
Joined: Tue May 22, 2007 12:00 am

Import and Export

Post by history » Fri Apr 25, 2008 5:34 pm

I seem to be having some problems importing templates as well as XML files. The files are uploaded to you can you review and comment on what I am missing.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 28, 2008 10:15 am

Hi history,

The problem seems related to the fact that each series first value is -Infinity. This is a defect that I've added to the bug list (TF02013018) to be fixed for next 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
Image Image Image Image Image Image
Instructions - How to post in this forum

histry
Newbie
Newbie
Posts: 79
Joined: Thu Aug 10, 2006 12:00 am

Post by histry » Tue Apr 29, 2008 4:47 pm

I changes the template to not export the data and tried to import the new template without data and had the same issue. I will upload the template without data.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 30, 2008 8:43 am

Hi histry,

Thanks for the file and information. I could reproduce the issue here, debugged it and found the error happens when the template file loads an object of type Honeywell.Desktop.OfficeInterface.TrendRectangleTool. Is that a custom object you created? If so you may be interested in reading this thread about custom objects serialization/deserialization and also read Tutorial19 - Custom Serialization.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

histry
Newbie
Newbie
Posts: 79
Joined: Thu Aug 10, 2006 12:00 am

Post by histry » Wed Apr 30, 2008 12:04 pm

Thanks

yes, I will take a look


Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 27, 2008 8:03 am

Hi histry,

We are currently investigating TF02013018 and we are wondering how did you create the xml file? In the file, all series begin and end with a double.NegativeInfinity. This means the file can't have been generated from TeeChart, as the following code does not work:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Series.Add(typeof(Line));
      tChart1[0].Add(1, double.NegativeInfinity);
      tChart1[0].Add(2, 2);
      tChart1[0].Add(3, 3);
      tChart1[0].Add(4, double.NegativeInfinity);
    }
So could you please send us the code you used to generate the chart that generated the XML file?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

histry
Newbie
Newbie
Posts: 79
Joined: Thu Aug 10, 2006 12:00 am

Post by histry » Tue May 27, 2008 12:10 pm

not sure what you are asking.

The data is created outside Teechart and series are populated as follows

double?[] timestamps;
double?[] dataValues;
...
...
dataPoints.Add(timestamps, dataValues);


The XML file is created from the series data within Teechart using the Export command.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue May 27, 2008 1:30 pm

Hello,
histry wrote:not sure what you are asking.
Well, I guess it's really to confirm that the problem can be represented in this code:

Code: Select all

   public Form3()
    {
      InitializeComponent();
      InitializeChart();
    }

    private void InitializeChart()
    {
      tChart1.Series.Add(typeof(Line));
      tChart1[0].DefaultNullValue = double.NegativeInfinity;
      tChart1[0].Add(1, double.NegativeInfinity, Color.Transparent);
      tChart1[0].Add(2, 2);
      tChart1[0].Add(3, 3);
      tChart1[0].Add(4, double.NegativeInfinity, Color.Transparent);
    }

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Export.Data.XML.Save(@"C:\temp\inf.xml");
    }

    private void button2_Click(object sender, EventArgs e)
    {
      tChart1.Clear();
      XmlSource source = new XmlSource(tChart1.Chart);
      source.Load(@"C:\temp\inf.xml");
    }
When an error is thrown on clicking button2, that is, trying to import the TeeChart generated file. Can you please give us an indication that your case is similar to the one above?
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
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue May 27, 2008 3:02 pm

Hello,
Chris wrote:Can you please give us an indication that your case is similar to the one above?
Ok, the code posted in my last message in this thread has now been fixed. The inf.xml generated looks like this:

Code: Select all

<chart>
 <series title="line1" type="Line" color="FF4466A3">
  <points count="4">
<point color="00FFFFFF" X="1" Y="-Infinity"/>
<point X="2" Y="2"/>
<point X="3" Y="3"/>
<point color="00FFFFFF" X="4" Y="-Infinity"/>
  </points>
 </series>
</chart>
Please note that the format of this file is different from your stripchart.xml, hence my reason for asking if that file was generated in a way similar to my code. The important difference is in the <point color attribute which specifies the null value (Color.Transparent in Hex). Simply importing in your stripchart.xml even with this fix in place will still produce an error.
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/

Post Reply