![]() | 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: | TChartAxis.InternalCalcSize doesn't consider multiline for the height | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | yeray alonso <yeray> |
| Component: | Axis | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | david, jonp |
| Priority: | High | ||
| Version: | 140923 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| URL: | http://www.teechart.net/support/viewtopic.php?f=3&t=15213 | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | Delphi 7 |
| Attachments: | test app for labels rotation | ||
Difficult to fix. Its a catch-two situation. When we're calculating the height, we don't know yet how many labels will be displayed or not. And we need the height to calculate later which labels should display. The solution is to use the Axis.Texts.Size property, setting it manually to a number of pixels. Calculating the correct height involves lots of steps that are done only when drawing the labels, not when calculating the needed space. Axis orientation and labels rotation angle, the number of visible series, if that series have texts or not, Texts.MultiLine, the LabelsFormat string and many other settings affect the calculation, so its a complex thing to improve. I've implemented a possible solution, but it has a **massive** performance hit difficult to avoid. Created attachment 314 [details]
test app for labels rotation
Attached the internal project for testing labels rotation
This customer found the problem with the multi-lined axis labels appeared with November 2013 release (2013.09.131119) http://www.teechart.net/support/viewtopic.php?p=67590#p67590 |
TChartAxis.InternalCalcSize doesn't consider multiline for the height. If you have axis labels with multiple lines the space taken for the labels isn't enough and they are cut. uses Series; procedure TForm1.FormCreate(Sender: TObject); var i: Integer; begin Chart1.Align:=alClient; Chart1.View3D:=false; Chart1.Legend.Visible:=false; with Chart1.AddSeries(TBarSeries) as TBarSeries do begin FillSampleValues(); Marks.Visible:=false; for i:=0 to Count-1 do Labels[i]:=FormatFloat('#0.##', YValue[i]) + #13 + 'Extra Line 1' + #13 + 'Extra Line 2'; end; end;