Adding multiple points after Template.Load crashes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
akshobrao
Newbie
Newbie
Posts: 8
Joined: Fri Aug 25, 2023 12:00 am

Adding multiple points after Template.Load crashes

Post by akshobrao » Tue Apr 16, 2024 7:09 pm

Visual Studio 2022
Target framework .NET 6.0
Steema.TeeChart.net Version 4.2024.4.12

After a template is imported using the Load Command, it crashes after adding more the one point to the series. It crashes in 2nd LoadData. This example works if only 1 point is added.

public partial class Form1 : Form
{
Steema.TeeChart.TChart tChart1;
public Form1()
{
InitializeComponent();
tChart1 = new Steema.TeeChart.TChart();
this.Controls.Add(tChart1);
tChart1.Dock = DockStyle.Fill;
tChart1.Axes.Bottom.Visible = true;
tChart1.Axes.Left.Visible = true;
tChart1.Axes.Right.Visible = false;
tChart1.Legend.Visible = false;

Line line = new Line();
tChart1.Chart.Series.Add(line);

LoadData();

TemplateExport template = tChart1.Export.Template;
template.IncludeData = false;
tChart1.Export.Template.Save("template.json");


tChart1.Import.Template.Load("template.json");
LoadData();
}


private void LoadData()
{
var line = tChart1.Chart.Series[0];
line.Add(1, 1);
line.Add(2, 2);
line.Add(3, 3);
}
}
Attachments
Screenshot 2024-04-16 140524.png
Screenshot 2024-04-16 140524.png (29.3 KiB) Viewed 120 times

Edu
Newbie
Newbie
Posts: 5
Joined: Tue Nov 28, 2023 12:00 am

Re: Adding multiple points after Template.Load crashes

Post by Edu » Thu Apr 18, 2024 8:10 am

Thank you for the issue report. We are investigating possible causes.
Edu
Steema Support

Post Reply