Page 1 of 1
Chart.Export.Template.Save out of memory
Posted: Tue Jun 08, 2010 9:51 am
by 15654539
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
Re: Chart.Export.Template.Save out of memory
Posted: Wed Jun 09, 2010 10:38 am
by 10050769
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,
Re: Chart.Export.Template.Save out of memory
Posted: Wed Jun 09, 2010 2:42 pm
by 15654539
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!
Re: Chart.Export.Template.Save out of memory
Posted: Thu Jun 10, 2010 8:58 am
by 10050769
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,
Re: Chart.Export.Template.Save out of memory
Posted: Fri Jun 11, 2010 9:54 am
by 15654539
Hello,
I have just uploaded a demo project. Push the "add serie" button, and after the save button and it fails....
Thanks
Re: Chart.Export.Template.Save out of memory
Posted: Fri Jun 11, 2010 11:12 am
by 10050769
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,
Re: Chart.Export.Template.Save out of memory
Posted: Fri Jun 11, 2010 11:45 am
by 15654539
I have just downloaded the last version of teechart and it was solved.
Thanks