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 1144

Summary: Long strings in the legend
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: LegendAssignee: Steema Issue Manager <issuemanager>
Status: CONFIRMED ---    
Severity: enhancement    
Priority: ---    
Version: 150120   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2015-02-18 05:33:45 EST
uses Series;

Same as Java B1143:
http://bugs.teechart.net/show_bug.cgi?id=1143

When we have a very string in a series point/title to be shown in the legend, the legend isn't shown:

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  with Chart1.AddSeries(TBarSeries) do
  begin
    FillSampleValues;

    for i:=0 to Count-1 do
    begin
      if (i=2) then
        //Labels[i]:='This is a really really looooooooong string for the point index ' + IntToStr(i);
        //Labels[i]:='This is a really really looooooooong string for the point index ' + IntToStr(i) + '. This is so long because we want to long strings in the legend'
        Labels[i]:='This is a really really looooooooong string for the point index ' + IntToStr(i) + '. This is so long because we want to test how the chart looks when there are long strings in the legend'
      else
        Labels[i]:='Point Index ' + IntToStr(i);

    end;
  end;

  Chart1.Legend.Alignment:=laBottom;
end;

Adding a TLegendScrollBar doesn't fix it.

We could add a MaxWidth property. If the legend can't be drawn within this MaxWidth, the strings could be cut (with "..." at the end), we could automatically add a LegendScrollBar, or we could multiline the legend.
Comment 1 yeray alonso 2015-02-18 05:52:37 EST
Also added for .NET:
http://bugs.teechart.net/show_bug.cgi?id=1145