Page 1 of 1

Show in Legend Checkbox on Series Tab Does Nothing

Posted: Tue Jun 20, 2023 6:50 pm
by 16095093
Hello,

This bug applies to both net4x and net6. This is also a regression.

Open and extract the attached sample project
The project is multitargeted to net472 and net6.0-windows and uses the latest TeeChart Nuget package
Run the application
Click the options button to open the options dialog
Go to the Legend tab and change the legend style to Series Names
Go to the Series tab, then General tab
Uncheck the "Show in Legend" checkbox
If you move the options dialog over, you should note that it does not remove the series in the legend.
If you click on the "Date Time" checkbox under horizontal axis, you'll notice the legend updates
If you tick "Show in Legend" on again, it will not appear. Uncheck "Date Time" and it appears.

Checking/unchecking just "Show in Legend" does not update the chart. This is a regression (compared to v2009 which is what we used to use).

Like the last bug I reported, it would be helpful to know the changes you mode so we can keep our copy of the source in-sync until the next update.

Kind Regards,

Kris Culin
Bentley Systems, Inc.

Re: Show in Legend Checkbox on Series Tab Does Nothing

Posted: Wed Jun 21, 2023 4:42 pm
by Christopher
Hello Kris,

thank you for your bug report, which I have documented in id=2616. The fix to this is:

Code: Select all

diff --git a/TeeChart.PCL.NET5/Headless/TeeChart/Series.cs b/TeeChart.PCL.NET5/Headless/TeeChart/Series.cs
index ec7fe6c2..db04b190 100644
--- a/TeeChart.PCL.NET5/Headless/TeeChart/Series.cs
+++ b/TeeChart.PCL.NET5/Headless/TeeChart/Series.cs
@@ -4914,6 +4914,8 @@ Localizable(true),
                 _function.Chart = Chart;
             }
 
+            Legend.Chart = Chart;
+
             Chart?.Invalidate();
         }
 
diff --git a/TeeChart/Editors/Series/SeriesEditor.cs b/TeeChart/Editors/Series/SeriesEditor.cs
index 186de460..f1decfad 100644
--- a/TeeChart/Editors/Series/SeriesEditor.cs
+++ b/TeeChart/Editors/Series/SeriesEditor.cs
@@ -805,7 +805,7 @@ namespace Steema.TeeChart.Editors
 
         private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
         {
-            series.Legend.visible = cbLegend.Checked;
+            series.Legend.Visible = cbLegend.Checked;
         }
 
         private void CheckCBSamples()