Chart.Export.Template.Save out of memory

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Chart.Export.Template.Save out of memory

Post by acastro » Tue Jun 08, 2010 9:51 am

Hello,

I'm having problems exporting a chart, because the chart has only a serie but with 122,652 values. I get this error:

Code: Select all

Property accessor 'DataSource' on object 'Steema.TeeChart.Styles.Line' threw the following exception:'Exception of type 'System.OutOfMemoryException' was thrown.'
I tried running:

Code: Select all

          chart.Export.Template.IncludeData = false;
            chart.Export.Template.Save(path);
Because I don't need to save the data, but I think the includeData= false sentence is not running because it spend quite lot time trying to save an then throws the same error...

I tried deleting the data of the serie before save it, but then chart deletes the data to the user and to get it from the database spends too time to get it again transparently.

Do you know any way to solve it?

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Chart.Export.Template.Save out of memory

Post by Sandra » Wed Jun 09, 2010 10:38 am

Hello wakeup,

I have tried to reproduce your problem, and here it doesn't appear using next code and changing property chart1.Export.Tamplate.IncludeData to true or false:

Code: Select all

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

        private Steema.TeeChart.TChart chart1, chart2;
        private Steema.TeeChart.Styles.Line line1;
        private void InitializeChart()
        {
           chart1 = new Steema.TeeChart.TChart();
           chart2 = new Steema.TeeChart.TChart();
           this.Controls.Add(chart1);
           this.chart1.Location = new System.Drawing.Point(-3, 141);
           this.chart1.Size = new System.Drawing.Size(475, 293);
           this.chart1.TabIndex = 0;
           this.Controls.Add(chart2);
           this.chart2.Location = new System.Drawing.Point(493, 141);
           this.chart2.Size = new System.Drawing.Size(453, 293);
           this.chart2.TabIndex = 1;
           line1= new Steema.TeeChart.Styles.Line(chart1.Chart);
           line1.Add(1, 122);
           line1.Add(2, 652);
           chart1.Export.Template.IncludeData = false;//true;
           chart1.Export.Template.Save(@"C://TeeChart1.ten");
           chart2.Import.Template.Load(@"C://TeeChart1.ten");
        }
Please, check if previous code works as you want. If it doesn't work for you, please, modify code because we can reproduce your problem here.

Thanks,
Best Regards,
Sandra Pazos / 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

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Chart.Export.Template.Save out of memory

Post by acastro » Wed Jun 09, 2010 2:42 pm

I tested it better and your are right it doesn't save the data, but it save something big.

I can't reproduce the problem with your example, but I have attached in this post my chart saved without data, but as you can be its size is 3MB!

What is it saving?

Thanks!
Attachments
example.zip
(423.52 KiB) Downloaded 450 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Chart.Export.Template.Save out of memory

Post by Sandra » Thu Jun 10, 2010 8:58 am

Hello wakeup,

Please, could you send us a simple example project we can run "as-is" to reproduce the problem here, we can help you?

Thanks,
Best Regards,
Sandra Pazos / 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

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Chart.Export.Template.Save out of memory

Post by acastro » Fri Jun 11, 2010 9:54 am

Hello,

I have just uploaded a demo project. Push the "add serie" button, and after the save button and it fails....

Thanks
Attachments
Example.zip
(470.11 KiB) Downloaded 475 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Chart.Export.Template.Save out of memory

Post by Sandra » Fri Jun 11, 2010 11:12 am

Hello wakeup,

I tested your project using last version of TeeChart .Net. I am following your indications for run your project and it generates a file.tee of 5KB, please see attached file.
test.zip
(1.52 KiB) Downloaded 481 times
Could you say us what version of TeeChart.Net are you using now?

Thanks,
Best Regards,
Sandra Pazos / 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

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Chart.Export.Template.Save out of memory

Post by acastro » Fri Jun 11, 2010 11:45 am

I have just downloaded the last version of teechart and it was solved.
Thanks

Post Reply