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 2658 - Setting an angle for a custom label doesn't work
Summary: Setting an angle for a custom label doesn't work
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Axis (show other bugs)
Version: 39.231109
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-30 06:32 EST by yeray alonso
Modified: 2023-11-30 06:32 EST (History)
1 user (show)

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


Attachments
screenshot (32.50 KB, image/png)
2023-11-30 06:32 EST, yeray alonso
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2023-11-30 06:32:49 EST
Created attachment 1061 [details]
screenshot

In the following example, I've created two charts to test we don't break automatic labels while implementing a fix.
The problem can be seen in the chart at the right, as you can see in the screenshot attached.

uses Chart, Series, TeEngine;

var Charts: array of TChart;

procedure TForm1.FormCreate(Sender: TObject);

  procedure CreateChart(var AChart: TChart);
  begin
    AChart:=TChart.Create(Self);

    with AChart do
    begin
      Parent:=Self;

      if AChart=Charts[0] then
         Align:=alLeft
      else
         Align:=alClient;

      Color:=clWhite;
      Gradient.Visible:=False;
      Walls.Back.Color:=clWhite;
      Walls.Back.Gradient.Visible:=False;
      Legend.Hide;
      View3D:=False;
    end;
  end;

var i: Integer;
const nZones=2;
begin
  SetLength(Charts, nZones);

  for i:=0 to nZones-1 do
  begin
    CreateChart(Charts[i]);
    Charts[i].AddSeries(TLineSeries).FillSampleValues(5);
  end;
  Self.Width:=Charts[0].Width*2;

  Charts[0].Title.Text.Text:='LabelsAngle and Title Angle';
  with Charts[0].Axes.Bottom do
  begin
    LabelsAngle:=45;
    Title.Text:='Bottom axis';
    Title.Angle:=90;
  end;

  Charts[1].Title.Text.Text:='LabelsAngle and Custom Labels';
  with Charts[1].Axes.Bottom do
  begin
    LabelsAngle:=45;
    Items.Clear;
    for i:=0 to Charts[1][0].Count-1 do
    begin
      Items.Add(i, 'label'+IntToStr(i));
      if i=2 then
      begin
        Items[Items.Count-1].Format.Angle:=315;  // this doesn't work
      end;
    end;
  end;
end;