.NET Framework 4.8
Steema.TeeChart.net Version 4.2023.11.6
When importing a function, the data source is set to null, therefore no data is found. In the tchart version 4.2023.4.18 the importing of a function was working correctly as it was setting the data source to the correct series. Has this behavior changed? Also when importing the chart the legend does not come up correctly as seen by screenshot, it is aligned to the left. Once clicked inside thee chart area the legend moves to the bottom.
Code: Select all
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;
LoadData();
tChart1.Export.Template.Save("template.json");
tChart1.Import.Template.Load("template.json");
ReLoadData();
}
private void LoadData()
{
tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
Series line = new Line();
tChart1.Chart.Series.Add(line);
for (int i = 0; i < 1000; i++)
{
line.Add(i, i);
}
Line functionLine = new Line
{
Title = $"Average",
DataSource = new object[] { line },
Function = new Average
{
PeriodStyle = PeriodStyles.NumPoints,
Period = 20,
PeriodAlign = PeriodAligns.Last
}
};
tChart1.Chart.Series.Add(functionLine);
}
private void ReLoadData()
{
for (int i = 0; i < 1000; i++)
{
tChart1.Chart.Series[0].Add(i, i);
}
tChart1.Chart.Series[1].Function.Recalculate();
}
Akshob