Application window freeze problems with 3.2015.0108

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
plamen
Newbie
Newbie
Posts: 9
Joined: Thu Jan 08, 2015 12:00 am

Application window freeze problems with 3.2015.0108

Post by plamen » Mon Feb 09, 2015 10:24 am

Hello,

with the latest version 3.2015.0108 I am experiencing random freezes that result in the whole application unable to redraw, and also I can see the CPU load goes up. Simply replacing latest version with the previous i have (3.2013.1219) and the freezes do not occur anymore, without changing anything in the code. I do not have simple code to reproduce, because the problem occurs in a large application and I am not allowed to disclose any portion of it. I can see that one of the freezes occurs when I have large panel, JScrollPane inside and the chart is somewhere below the field of view. When I scroll down to it, the application freezes the moment the first row of the chart commander has to be shown. I will see whether I can create simple code snipped that reproduces this. Also I noticed it when filling a chart dynamically using a thread. If the series that I fill data in are added to the chart - the freeze occurs, if I fill the series as a stand-alone object and then add it to the series - then no freeze occurs and the chart is properly redrawn. As in previous case - simply rolling back the older version solves these problems. What can I do to help more with this issue?

regards,
Plamen

Yeray
Site Admin
Site Admin
Posts: 8703
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Application window freeze problems with 3.2015.0108

Post by Yeray » Mon Feb 09, 2015 4:28 pm

Hi Plamen,
plamen wrote:I do not have simple code to reproduce, because the problem occurs in a large application and I am not allowed to disclose any portion of it.
As you'll understand, it's very difficult for us to debug and find the origin of a problem without a simple example reproducing it.
We understand it's sometimes difficult to reduce your projects to the minimum indispensable to reproduce a situation but if you reach it, you should end with an application with random data or at least without any sensitive information.
plamen wrote:I can see that one of the freezes occurs when I have large panel, JScrollPane inside and the chart is somewhere below the field of view. When I scroll down to it, the application freezes the moment the first row of the chart commander has to be shown.
Can you reproduce this in a new simple application with just a Chart and a Commander on a JScrollPane?
plamen wrote:I will see whether I can create simple code snipped that reproduces this.
It would be really helpful.
plamen wrote:Also I noticed it when filling a chart dynamically using a thread. If the series that I fill data in are added to the chart - the freeze occurs, if I fill the series as a stand-alone object and then add it to the series - then no freeze occurs and the chart is properly redrawn.
This sounds as a redrawing problem. Note that when a point is added the chart is repainted to show it.
If you are adding several points to a series at once, a good practice is to disable autorepaint before adding the points, and reenable it once you finished adding points.
However, this shouldn't have changed with the versions. So there could be some problem here we'll be glad to investigate.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

plamen
Newbie
Newbie
Posts: 9
Joined: Thu Jan 08, 2015 12:00 am

Re: Application window freeze problems with 3.2015.0108

Post by plamen » Tue Feb 10, 2015 12:33 pm

Hello,

this is to inform you, that so far I was unable to reproduce the error starting with new application. Still the freezes occur in the large application with the latest TeeChart version, so I will need to investigate further. Will let you know if I find something.

regards,
Plamen

Yeray
Site Admin
Site Admin
Posts: 8703
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Application window freeze problems with 3.2015.0108

Post by Yeray » Tue Feb 10, 2015 3:14 pm

Hi Plamen,
plamen wrote:this is to inform you, that so far I was unable to reproduce the error starting with new application. Still the freezes occur in the large application with the latest TeeChart version, so I will need to investigate further. Will let you know if I find something.
There's another bug we identified and fixed a couple of weeks ago that may be related. I'm not sure if the fix for it will fix the problem you are experiencing but it's worth a try.

In the sources, at com\steema\teechart\axis\Axis.java you'll find a method named maxLabelsValueWidth() ending as follows:

Code: Select all

    private int maxLabelsValueWidth() {
        //...
        if (tmp != 0) {
            tmpResult = 0;
            int limit = 5000;

            do {
                tmpResult = Math.max(tmpResult, chart.multiLineTextWidth(labels.labelValue(tmpB)).width);

                tmpB -= tmp;
                limit -= 1;
            } while ((tmpB < tmpA) || (limit == 0));
        } else {
            tmpResult = (chart.getGraphics3D().textWidth(" ")
                    + Math.max(chart.multiLineTextWidth(
                                    labels.labelValue(tmpA)).width,
                            chart.multiLineTextWidth(labels.labelValue(tmpB)).width));
        }
      
        return tmpResult;
    }
Change it for just this:

Code: Select all

    private int maxLabelsValueWidth() {
        //...
        double tmpC = tmp * (int) ((iMaximum - tmp) / tmp);
        tmpResult = chart.getGraphics3D().textWidth(" ")
                + Math.max(Math.max(chart.multiLineTextWidth(labels.labelValue(tmpA)).width,
                                chart.multiLineTextWidth(labels.labelValue(tmpB)).width),
                        chart.multiLineTextWidth(labels.labelValue(tmpC)).width);
      
        return tmpResult;
    }
If you find any problem in the process or if the change doesn't fix the problem for you, don't hesitate to let us know.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

plamen
Newbie
Newbie
Posts: 9
Joined: Thu Jan 08, 2015 12:00 am

Re: Application window freeze problems with 3.2015.0108

Post by plamen » Wed Feb 11, 2015 8:53 am

Hi Yeray,

Thanks for your reply. I will try to implement this change. I found the source file file and made the change in it. What is the best way to compile/package the component? Is there something specific I need to know?

regards,
Plamen

Yeray
Site Admin
Site Admin
Posts: 8703
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Application window freeze problems with 3.2015.0108

Post by Yeray » Wed Feb 11, 2015 9:27 am

Hi Plamen,

In Swing, you can directly use the sources in your project. If you are using Netbeans:
- Create a "New project...", a "Java Project with Existing Sources"
- Give it a name and a folder for the project files, not necessarily in where TeeChart is installed
- In the "Existing Sources" window, "Add Folder..." pointing to where the "com" folder of the TeeChart Java sources are. Ie: "C:\Program Files (x86)\Steema Software\TeeChartJavaSrc_3.2015.0108\src\Swing" and Finish.
- In your project "Properties", remove the TeeChart.Swing.jar from the "Libraries" section, and navigate to the path where you saved the source project files in the second step above through the "Add Project..." option.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

plamen
Newbie
Newbie
Posts: 9
Joined: Thu Jan 08, 2015 12:00 am

Re: Application window freeze problems with 3.2015.0108

Post by plamen » Wed Feb 11, 2015 10:20 am

Hi Yeray,

I am using Eclipse. I have done the change, built and used the modified source tree and can confirm that the freezes are not observed anymore. Let me test a bit more today and I will get back to you with more precise info. Thanks for your cooperation. If this change is what fixes the bug, is there an estimated date on which the next teechart release will incorporate it, or I need to create my own TeeChart.Swing.jar and use it if next release date is far in the future?

regards,
Plamen

plamen
Newbie
Newbie
Posts: 9
Joined: Thu Jan 08, 2015 12:00 am

Re: Application window freeze problems with 3.2015.0108

Post by plamen » Wed Feb 11, 2015 11:58 am

Hi again,

this is to inform you, that I have created Eclipse project here with the source + resources and arranged for a Maven build infrastructure, so in general I am ready to incorporate other source code changes and build/package them if need be.

regards,
Plamen

Yeray
Site Admin
Site Admin
Posts: 8703
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Application window freeze problems with 3.2015.0108

Post by Yeray » Wed Feb 11, 2015 1:07 pm

Hi Plamen,

I'm afraid I can't tell you a date for the next maintenance release to be published. However, if you or any other customer prefers it, we can prepare a beta version with the current sources.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

plamen
Newbie
Newbie
Posts: 9
Joined: Thu Jan 08, 2015 12:00 am

Re: Application window freeze problems with 3.2015.0108

Post by plamen » Wed Feb 11, 2015 1:59 pm

Hi Yeray,

if the beta will contain only this bugfix, I essentially already have it, but if other bugfixes are going to go in - then of course a version with less bugs is always preferable :)
Anyway, let's see what other customers say about it, for now I am happy with this temporary solution. Thanks again for your cooperation!

regards,
Plamen

Post Reply