Resize Not Working with Custom Axes (Regression)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Resize Not Working with Custom Axes (Regression)

Post by Kris C » Thu May 11, 2023 4:15 pm

Hello,

For this issue, a sample project reproducing the issue was uploaded using the upload service under kris.culin@bentley.com using the filename TeeChartAnnotationTable.zip.

Extract the project and open the solution in Visual Studio 2022. Make sure you restore NuGet packages as I am using the latest TeeChart NuGet package released on 4/18.

Run the program and open the "Profile Pond 1 to Pond 2 with Annotation Table.ten" file in the DataFiles folder using the Data button in the bottom-left corner of the dialog that opens. This will load the data and configure the bottom 1/2 of the chart.

The bottom 1/2 of the chart is what we call the "annotation table" and it uses some custom axes and settings in the chart control.

Once the data is loaded, resize the window vertically up and down and watch the text. You'll see the text jump around a bit which is a regression. Also included in the DataFiles folder is a mp4 video that shows our software that uses the TeeChart version from 2009. This version of TeeChart does *not* have the issue. When you watch the video, notice how the font actually gets smaller as the vertical height of the form gets smaller. The text does overlap but that is OK with us. It is better than the text jumping around.

The issue occurs under net472 and it is a regression. A fix is requested. Because of the specific use of the annotation table, we cannot test under net6 right now, so it is unclear if it occurs with net6.

If you have any questions or need additional details, please ask.

Kind Regards,

Kris Culin
Bentley Systems, Inc.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Christopher » Mon May 15, 2023 11:51 am

Hello,
Kris C wrote:
Thu May 11, 2023 4:15 pm
If you have any questions or need additional details, please ask.
Thank you. Yes; I notice that the Custom Axes labels look quite different to start with:
Screenshot from 2023-05-15 13-34-15_2.png
Screenshot from 2023-05-15 13-34-15_2.png (475.24 KiB) Viewed 41705 times
And:
Screenshot from 2023-05-15 13-42-35.png
Screenshot from 2023-05-15 13-42-35.png (121.5 KiB) Viewed 41705 times
Can you explain why the labels are lined up horizontally in the top version, but are not in the bottom one? This might be an important difference.

More generally though, setting FixedLabelSize to false gives some improvement:

Code: Select all

        private void buttonLoadData_Click(object sender, EventArgs e)
        {
            profileChart.Chart.Import.Template.LoadFileDialog();

            // Annotation
            // Annotation Table Labels
            // Annotation Table

            ToggleAnnotationTable(profileChart, true, profileChart.Width, profileChart.Height);

            for (int i = 0; i < profileChart.Axes.Custom.Count; i++)
            {
                profileChart.Axes.Custom[i].FixedLabelSize = false;
                profileChart.Axes.Custom[i].Labels.Separation = 0;
            }
        }
But a more specific fix will depend on the answer to my question.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Kris C » Tue May 16, 2023 2:33 pm

Hi Christopher,

Under my email address, kris.culin@bentley.com, I uploaded the file profile.cs using your upload file service.

This is a revised copy of our production version of the class. I removed code that was not directly related to this issue leaving the code we use to build the annotation table/labels.

Except for a few small bits, this code has *not* changed between the v2009 and v2023 versions. There was only a few API changes (related to zoom, legend a couple of other spots). But otherwise, the logic behind how the annotation table/labels are created is identical.

So, the bottom line here is that we provide the data in the exact same manner with both the v2009 and v2023 versions but the table jumps around with the latter when you change the height of the form where the TChart is located. That is the regression and what we need fixed.

I hope this helps with your debugging.

Kind Regards,

Kris Culin
Bentley Systems, inc.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Christopher » Tue May 16, 2023 3:20 pm

Hello Kris,
Christopher wrote:
Mon May 15, 2023 11:51 am
So, the bottom line here is that we provide the data in the exact same manner with both the v2009 and v2023 versions but the table jumps around with the latter when you change the height of the form where the TChart is located. That is the regression and what we need fixed.
It could be a regression, but that is not the only possibility. It could also be related to the change of default theme, or of the property new to later TeeChart versions which I mentioned to you in my last message of this thread.
Christopher wrote:
Mon May 15, 2023 11:51 am
I hope this helps with your debugging.
When I try to compile your Profile.cs, I obtain:
Screenshot from 2023-05-16 17-14-57.png
Screenshot from 2023-05-16 17-14-57.png (134.93 KiB) Viewed 41674 times
We usually ask for a minimal, reproducible example to speed up our responses to our clients. Is there going to be any way you can get one to us please? If not, maybe you could suggest the best way for us to try and get something up and running at our end.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Kris C » Fri May 19, 2023 8:44 pm

Hi Christopher,

I did provide a sample. I created the ten data file (using the Save button in the TeeChart options dialog) which I included in my zip file. You just need to load that ten file and you can reproduce the jumping annotation table when you resize.

I can tell you that the code has not changed much between the use of the v2009 and v2023 versions of TeeChart. There were a few minor API changes but nothing that should cause the jumping table.

The profile.cs class I provided includes the code that sets up the lines and adds the data. No, it would not compile, but it does show you what we are doing in our production code. Hopefully that class along with the provided sample is sufficient.

If you need something more detailed, please let me know ASAP. it will take me some time to do that.

Thanks,

Kris Culin
Bentley Systems, Inc.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Christopher » Mon May 22, 2023 7:13 am

Hello Kris,
Kris C wrote:
Fri May 19, 2023 8:44 pm
If you need something more detailed, please let me know ASAP. it will take me some time to do that.
I asked you for something more detailed in my last message in this thread.

As you can see in the screenshot in it, the example you sent us is not a minimal, reproducible example because it produces 123 compile-time errors when we try to run it.

The example you mention of loading a ten file is not minimal, as it gives us no immediate way to see the difference we encapsulated in our question to you:
Can you explain why the labels are lined up horizontally in the top version, but are not in the bottom one? This might be an important difference.
Of course we are very interested in resolving this problem for you, but we really would appreciate your cooperation in being able to reproduce this issue at our end. As things stand we are going to need dozens of people hours to work out what might be going on, which unfortunately will mean our reply will not be 'ASAP'.

We will start investigations at our end today, and the first thing we'll try to understand is why the custom axis labels do not line up horizontally in the latest version.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Kris C » Mon May 22, 2023 8:08 am

Hi Christopher,

I totally understand. I will work to create a sample without loading the ten file. However, this will take some time because of how embedded the related code is in our production code. This will probably take a week and it will be part-time for me as I won't get the authorization to work "just" on this sample. I hope to have something to post by end of the week.

In the meantime, can you look at the resize issue itself? You have the data to load, and the issue occurs when you are resizing the window, not when you load the data. It appears to me, at least on the surface, that the issue occurs when the chart is resizing so that is where it should be debugged.

I hope to have some posted by end of the week.

Kind Regards,

Kris Culin
Bentley Systems, Inc.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Christopher » Mon May 22, 2023 9:10 am

Hello Kris,

when we add in a Form_Load event to your TeeChartAnnotationTable example:

Code: Select all

        private void ProfileAnnotationForm_Load(object sender, EventArgs e)
        {
            var dir = Path.GetFullPath(Directory.GetCurrentDirectory() + @"..\..\..\DataFiles\Profile Pond 1 to Pond 2 with Annotation Table.ten");

            profileChart.Import.Template.Load(dir);

            ToggleAnnotationTable(profileChart, true, profileChart.Width, profileChart.Height);

            for (int i = 0; i < profileChart.Axes.Custom.Count; i++)
            {
                profileChart.Axes.Custom[i].FixedLabelSize = false;
                profileChart.Axes.Custom[i].Labels.Separation = 0;
            }

            profileChart.Series.WithTitle(ANNOTATION_TABLE).Marks.AutoPosition = false;
        }
We obtain this screencast when we resize the form. Could you please check this code at your end and tell us how far way this is from what you are expecting?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Re: Resize Not Working with Custom Axes (Regression)

Post by Kris C » Mon Oct 16, 2023 9:17 am

Hi Christopher,

I apologize for the long delay in a response. Since my last posting on this issue, assignments have changed, and this is the first chance I've had to reply.

I reviewed your earlier responses again and looked at both the sample code and production code and was able to put into place the AutoPosition assignment as well as the FixedLableSize and Labels.Separation assignments as you suggested. This all appears to be working consistently with the v2009 version of TeeChart.

I really do appreciate the quick response time your support team provides. It is very much appreciated and does not go unnoticed here.

Kind Regards,

Kris Culin
Bentley Systems, inc.

Post Reply