Steema Issues Database

Note: 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.



Bug 101

Summary: Legend text with CRLF overlaps other items.
Product: VCL TeeChart Reporter: narcís calvet <narcis>
Component: LegendAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: normal CC: david
Priority: ---    
Version: 131016   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: https://forums.embarcadero.com/thread.jspa?threadID=96963&tstart=0
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description narcís calvet 2013-11-14 07:28:09 EST
In Delphi XE5 Upd1 TeeChart lite works different way as the previous versions (Pro version does the same). The CRLF were ignored in legend title. Now if the Series.LegendTitle property string has a CRLF the lines goes over other texts. See image: https://www.dropbox.com/sh/xy71xk3sby3zg6s/ozpZ9kbgGz

Code to reproduce:

uses VCLTee.Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues();
  Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues();

  Chart1[0].LegendTitle := 'This is' + #10#13 + 'a test';

  //Workaround
  //Chart1.Legend.VertSpacing:=15;
end;
Comment 1 david berneda 2013-11-14 09:44:21 EST
Fixed.

The fix covers several cases of text found inside the series LegendTitle or Title properties, when they are used to display at chart legend:

#10#13
#13#10
#13
#10

in all cases, they are replaced with a single space character.

A future wish would be enabling the legend to support multiple-lines of text for a legend item.  

Somewhat difficult, as currently legend items are considered everywhere to have an equal, fixed height in pixels based on legend font size (plus legend symbol height and margins if visible).

If this is done, then #13#10 chars would not need to be removed.