Page 1 of 1

Template Import Crashing - Marks.FollowSeriesColor and Cursor Tools

Posted: Tue Nov 07, 2023 2:14 pm
by 15696632
Visual Studio 2022
.NET Framework 4.8
Steema.TeeChart.net Version 4.2023.11.6

I am exporting a template and trying to import it back and it crashing. There are two pieces of code which seem to crash the loading of the template. First is line.Marks.FollowSeriesColor = true in the code below and the second is tChart1.Tools.Add(new Steema.TeeChart.Tools.CursorTool()); The code is below and i have commented out those two lines and it seems to work. When adding each line it crashes.

Code: Select all

	public partial class Form1 : Form
	{
		Steema.TeeChart.TChart tChart1;

		public Form1()
		{
			InitializeComponent();
			tChart1 = new Steema.TeeChart.TChart();
			this.Controls.Add(tChart1);
			tChart1.Dock = DockStyle.Top;
			InitializeChart();
		}

		private void InitializeChart()
		{
			tChart1.Chart.Header.Visible = true;

			Line line = new Line();
			line.Stairs = true;
			line.VertAxis = VerticalAxis.Left;
			//line.Marks.FollowSeriesColor = true;

			tChart1.Series.Add(line);
			//tChart1.Tools.Add(new Steema.TeeChart.Tools.CursorTool());
		}


		private void button1_Click(object sender, EventArgs e)
		{
			File.Delete("template.json");
			tChart1.Export.Template.IncludeData = false;
			tChart1.Export.Template.Save("template.json");
		}

		private void button2_Click(object sender, EventArgs e)
		{
			tChart1 = new Steema.TeeChart.TChart();
			this.Controls.Add(tChart1);
			tChart1.Dock = DockStyle.Top;
			tChart1.Import.Template.Load("template.json");
			tChart1.Refresh();
		}
	}

Re: Template Import Crashing - Marks.FollowSeriesColor and Cursor Tools

Posted: Wed Nov 08, 2023 7:12 am
by Marc
Hello,

Using your test code in a NET 4.8 project, I am unable to reproduce the problem. The template loads correctly, respecting the two code lines:

Code: Select all

line.Marks.FollowSeriesColor = true;
tChart1.Tools.Add(new Steema.TeeChart.Tools.CursorTool());
I have tested with TeeChart release 4.2023.11.6 in VSNet2019 and VSNet2022..

If you are able to send us a sample project that reproduces the issue, we'll check it for other elements/causes.

With thanks.
Regards,
Marc Meumann

Re: Template Import Crashing - Marks.FollowSeriesColor and Cursor Tools

Posted: Wed Nov 08, 2023 1:59 pm
by 15696632
Hi Marc,

It seems to crash here. I have attached screenshots when running in debug mode where it crashes. I created a winforms application with these files in it. Let me know if you can reproduce it with this.

Thanks.

Re: Template Import Crashing - Marks.FollowSeriesColor and Cursor Tools

Posted: Wed Nov 08, 2023 4:50 pm
by Marc
Hello,

Thanks you for the extra info. I can reproduce the error in a fresh project. My test project may be hanging on to a cached-package reference; I'm checking for differences and cause.

Regards,
Marc

Re: Template Import Crashing - Marks.FollowSeriesColor and Cursor Tools

Posted: Tue Nov 14, 2023 10:02 am
by Marc
Hello,

As a follow-up, A fix has been applied to TeeChart code to be included with the next update release.

Regards,
Marc