![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | paint lockup with axis autoscaling with less than 2 unique Y values | ||
|---|---|---|---|
| Product: | Java TeeChart | Reporter: | Jay Rinkel <jay.rinkel> |
| Component: | Axes | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | yeray |
| Priority: | --- | ||
| Version: | 3.2015.0108 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
| Attachments: | source code to demonstrate problem | ||
The code suggested was added to the production version the 19/01/2015 |
Created attachment 540 [details] source code to demonstrate problem If there are less than 2 unique Y values in a series and auto scaling is set to true for the vertical axis, the chart will cause Java / Swing to lockup during a paint cycle. Per Yeray Alonso, on 2/19/2015 the following is the change required to fix the bug, which we verified by compiling the source code with the change: In the sources, at com\steema\teechart\axis\Axis.java you'll find a method named maxLabelsValueWidth() ending as follows: 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)); } // GetAxisLabel=oldGetAxisLabel; return tmpResult; } Change it for just this: 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; }