Template Import Crashing - Marks.FollowSeriesColor and Cursor Tools
Posted: Tue Nov 07, 2023 2:14 pm
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.
.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();
}
}