Page 1 of 1

contour legend bug?

Posted: Tue Nov 14, 2023 11:05 am
by 15696078
When I add the series contour1 to tChart1 and click the legend, the program outputs an Exception.
To avoid this bug, is it possible to disable the legend click event?
Or is there another way?

Exception

Code: Select all

  StackTrace:
   at Steema.TeeChart.Legend.DoMouseDown(Int32 x, Int32 y)
   at Steema.TeeChart.Chart.DoMouseDown(Boolean isDoubleClick, MouseEventArgs e, Keys shift)
   at Steema.TeeChart.TChart.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
Data for testing is as follows.

Code: Select all

            double[] Y = { 0.5067, 0.5126, 0.5053, 0.5044, 0.5108, 0.505, 0.5056, 0.5028, 0.5007, 0.5033, 0.5036, 0.5044, 0.507, 0.5045, 0.504, 0.5057, 0.4969, 0.5057, 0.5085, 0.5024, 0.5, 0.5058, 0.5111, 0.5094, 0.466, 0.503, 0.5012, 0.5161, 0.5096, 0.5076, 0.5054, 0.5023, 0.5045, 0.4987, 0.5031, 0.4995, 0.4996, 0.5065, 0.5038, 0.4939, 0.5098, 0.5011, 0.5112, 0.5095, 0.5079, 0.504, 0.4974, 0.5021, 0.4992, };
            double[] X = new double[Y.Length];
            double[] Z = new double[Y.Length];

            for (int i = 0; i < X.Length; i++)
            {
                X[i] = (i % 7) - 3;
            }

            for (int i = 0; i < Z.Length; i++)
            {
                Z[i] = (i / 7) - 3;

            }

            contour1.Add(X, Y, Z);

Re: contour legend bug?

Posted: Wed Nov 15, 2023 9:06 am
by Marc
Hello,

Thank you for the bug report. I confirm that we can reproduce this problem for 3D Series for the latest build when Legend visible is true. We will check and fix the problem.

Regards,
Marc Meumann

Re: contour legend bug?

Posted: Fri Nov 17, 2023 8:43 am
by Marc
Update. The issue has been resolved for inclusion in the next update.

The problem relates to the LegendStyles.Palette setting for the Legend Style, hence a temporary workaround to be able to continue working could be to set it to "Values".

ie.

Code: Select all

tChart1.Legend.LegendStyle = LegendStyles.Values;
Regards,
Marc