Error loading native chart with smoothing!

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Matthew Scott
Newbie
Newbie
Posts: 16
Joined: Tue Apr 08, 2003 4:00 am

Error loading native chart with smoothing!

Post by Matthew Scott » Mon Mar 17, 2008 5:10 am

Dear All,

I using this chart to plot my series.

Code: Select all

	Steema.TeeChart.Styles.Line smoothseries = new Steema.TeeChart.Styles.Line(ctrTChart.Chart);
	Steema.TeeChart.Functions.Smoothing smoothing = new Steema.TeeChart.Functions.Smoothing(ctrTChart.Chart); 
	smoothseries.DataSource = tSeries;
	smoothseries.Function = smoothing;
	smoothing.Interpolate = false;
	smoothing.Factor = 5;
	smoothseries.CheckDataSource();
When I export to native chart

Code: Select all

ctrTChart.Export.Template.IncludeData = true;
ctrTChart.Export.Template.Save("c:\abc.ten");
Then I load I it back it has the following error (Not: without this function everything is working okay for loading the native chart - I am using version 1.1.1544)

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Index was out of range.  Must be non-negative and less than the size of the collection.
   at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
   at Steema.TeeChart.Styles.SeriesCollection.get_Item(Int32 index)
   at Steema.TeeChart.Import.Imports.GetLinkObject(String s)
   at Steema.TeeChart.Import.Imports.DeserializeFrom(SerializationInfo info, StreamingContext context)
   at Steema.TeeChart.Chart..ctor(SerializationInfo info, StreamingContext context)
   --- End of inner exception stack trace ---
   at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
   at System.Runtime.Serialization.ObjectManager.DoFixups()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at Steema.TeeChart.Import.TemplateImport.Load(Stream stream)
   at Steema.TeeChart.Import.TemplateImport.Load(String fileName)
   at ChartEditor.frmChartEditor.frmChartEditor_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
ChartEditor
    Assembly Version: 1.0.2998.21509
    Win32 Version: 1.0.2998.21509
    CodeBase: file:///D:/Sandbox/WUP-A%20DSF/ReportWizard/DSFReportWizard/bin/Debug/ChartEditor.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
TeeChart
    Assembly Version: 1.1.1544.23908
    Win32 Version: 1.1.1544.23908
    CodeBase: file:///D:/Sandbox/WUP-A%20DSF/ReportWizard/DSFReportWizard/bin/Debug/TeeChart.DLL
----------------------------------------
System.Web
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------
System.Xml
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Data
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Design
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.design/1.0.5000.0__b03f5f7f11d50a3a/system.design.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.



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 Mar 17, 2008 9:14 am

Hi Matthew,

At the version info page you can see latest TeeChart for .NET v1 release is Build 1.1.2531.28391. Can you please download this version and check if the problem persists?

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

Matthew Scott
Newbie
Newbie
Posts: 16
Joined: Tue Apr 08, 2003 4:00 am

Post by Matthew Scott » Mon Mar 17, 2008 11:06 am

Thanks for your supports. After updating I have the licensing problem. Could you please advise?

Code: Select all

An unhandled exception of type 'System.ComponentModel.LicenseException' occurred in system.dll

Additional information: An instance of type 'Steema.TeeChart.Chart' was being created, and a valid license could not be granted for the type 'Steema.TeeChart.Chart'. Please,  contact the manufacturer of the component for more information.


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 Mar 17, 2008 11:24 am

Hello Matthew,

Could you please read this thread about the same issue?

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

Matthew Scott
Newbie
Newbie
Posts: 16
Joined: Tue Apr 08, 2003 4:00 am

Post by Matthew Scott » Tue Mar 18, 2008 3:47 am

I still have the same error when loading the native with

Code: Select all

Steema.TeeChart.Styles.Line smoothseries = new Steema.TeeChart.Styles.Line(ctrTChart.Chart); 
   Steema.TeeChart.Functions.Smoothing smoothing = new Steema.TeeChart.Functions.Smoothing(ctrTChart.Chart); 
   smoothseries.DataSource = tSeries; 
   smoothseries.Function = smoothing; 
   smoothing.Interpolate = false; 
   smoothing.Factor = 5; 
   smoothseries.CheckDataSource(); 

even I update the TeeChart to version 1.1.2531.28391.

I uploaded the native file here and please download here and this file causes error as I posted in my very earliest message!

http://download.yousendit.com/D360932268559C79

Please help with this.


Regards,

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 Mar 18, 2008 8:52 am

Hi Matthew,

Thanks for the information.

I could reproduce the problem here using your template file but I'm not able to reproduce it using the code below. Could you please check if it works fine at your end? If the problem persists could you please modify the code or send us a simple example project we can run "as-is" to reproduce the problem here?

Code: Select all

			Steema.TeeChart.Styles.Points tSeries = new Steema.TeeChart.Styles.Points(tChart1.Chart);
			tSeries.FillSampleValues();
			Steema.TeeChart.Styles.Line smoothseries = new Steema.TeeChart.Styles.Line(tChart1.Chart);
			Steema.TeeChart.Functions.Smoothing smoothing = new Steema.TeeChart.Functions.Smoothing(tChart1.Chart);
			smoothseries.DataSource = tSeries;
			smoothseries.Function = smoothing;
			smoothing.Interpolate = false;
			smoothing.Factor = 5;
			smoothseries.CheckDataSource();

			System.IO.MemoryStream stream = new System.IO.MemoryStream();

			tChart1.Export.Template.Save(stream);
			
			stream.Position = 0;
			tChart1.Import.Template.Load(stream);
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

Matthew Scott
Newbie
Newbie
Posts: 16
Joined: Tue Apr 08, 2003 4:00 am

Post by Matthew Scott » Tue Mar 18, 2008 9:58 am

Dear Narcís,


I test it over here with your codes and it works. But it does not work with my codes series perhaps I have so many points in this? That should not be the case as it works with the normal series without calculation.


Could you please provide me further advice?


Regards,

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 Mar 18, 2008 10:34 am

Hello Matthew,

Thanks for the information. I don't think the problem is the number of points in the series. It is also very difficult for us being able to see where the problem is without knowing how the chart has been created. It would be very helpful if you could modify the code I posted (adding more points to the series if you feel necessary, eg.: FillSampleValues(10000)) or send us a simple example project we can run "as-is" so that we can reproduce the problem here.

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

Matthew Scott
Newbie
Newbie
Posts: 16
Joined: Tue Apr 08, 2003 4:00 am

Post by Matthew Scott » Tue Mar 18, 2008 10:42 am

Many thanks. I found the problem now, it causes error when you remove this

Code: Select all

tChart1.Chart
from this line of code

Code: Select all

tChart1.Chart Steema.TeeChart.Styles.Points tSeries = new Steema.TeeChart.Styles.Points();
Now I fixed it by adding this tChart1.Chart to my code.


Regards,
[/code]

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 Mar 18, 2008 10:50 am

Hi Matthew,

Thanks for the information. I'm glad to hear you solved the problem. This code add the series to the chart. Also please notice that the code that TeeChart for .NET v3 also works fine without adding the source series to the chart.
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

Post Reply