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 693 - Publish Legend title Offset property so you can move it. Text alignment would be also interesting
Summary: Publish Legend title Offset property so you can move it. Text alignment would...
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Legend (show other bugs)
Version: 140220
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 06:29 EDT by yeray alonso
Modified: 2014-04-03 04:34 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2014-04-02 06:29:05 EDT
Having a Title in the Legend, if you also have it with fosRoundRectangle ShapeStyle, the legend title may be cut by the legend border.

Code to reproduce the issue and workaround below. The workaround consists on manually positioning the legend's text accessing the TCustomTextShape's ITextOffset property. But it would be interesting to offer some public property to change this offset and/or have some Text Align property for the legend title.

uses Series, TeCanvas;

Type
  TCustomTextShapeClass = Class(TCustomTextShape);

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;

  for i:=0 to 4 do
    with Chart1.AddSeries(TLineSeries) as TLineSeries do
    begin
      FillSampleValues(10);
      Pointer.Visible:=true;
    end;

  Chart1.Legend.ShapeStyle:=fosRoundRectangle;
  Chart1.Legend.RoundSize:=40;
  Chart1.Legend.Title.Caption:='My series';
  Chart1.Legend.Symbol.Squared:=false;
  Chart1.Legend.Symbol.Width:=50;

  //Workaround
  {Chart1.Legend.Title.AutoSize:=false;
  Chart1.Legend.Title.Height:=20;
  Chart1.Legend.Title.Width:=80;
  TCustomTextShapeClass(Chart1.Legend.Title).ITextOffset:=13;{}
end;