![]() | 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: | axis title with angle=90 of custom vertical axis -> position horizontal position depends of Title Caption | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | Bert Kreisel <bert.kreisel> |
| Component: | Axis | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | johannes.barthelmaes, narcis, sandra |
| Priority: | High | ||
| Version: | 150120 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | RAD XE5 |
|
Description
Bert Kreisel
2015-03-16 03:32:06 EDT
This can be reproduced with the code snippet below. uses Series; procedure TForm1.FormCreate(Sender: TObject); Var MyAxis : TChartAxis ; begin Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues; Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues; MyAxis:=TChartAxis.Create(Chart1); MyAxis.Title.Caption:='Extra axis'; MyAxis.Title.Angle:=90; Chart1[0].CustomVertAxis:=MyAxis; end; At TeEngine.pas, implementing TChartAxis.GetAxisTitle as shown below solves the problem.
function TChartAxis.GetAxisTitle:TChartAxisTitle;
begin
if not Assigned(FAxisTitle) then
begin
FAxisTitle:=TChartAxisTitle.Create(ParentChart);
if not Self.Horizontal then
if (Self=ParentChart.FLeftAxis) or not Self.OtherSide then
FAxisTitle.InitAngle(90)
else
if (Self=ParentChart.FRightAxis) or Self.OtherSide then
FAxisTitle.InitAngle(270);
FAxisTitle.IDefaultAngle:=FAxisTitle.Angle;
end;
result:=FAxisTitle;
end;
The problem persists for (Angle=270 and not OtherSide) and (Angle=90 and OtherSide) Yes, that's right. Drop a TChart component into a form and use the code snippet below to reproduce it: uses Series; procedure TForm1.FormCreate(Sender: TObject); Var MyAxis1, MyAxis2 : TChartAxis; begin Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues; Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues; Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues; MyAxis1:=TChartAxis.Create(Chart1); MyAxis1.Title.Caption:='Extra axis'; MyAxis1.Title.Angle:=270; MyAxis2:=TChartAxis.Create(Chart1); MyAxis2.Title.Caption:='Extra axis'; MyAxis2.Title.Angle:=90; MyAxis2.OtherSide:=True; Chart1[0].CustomVertAxis:=MyAxis1; Chart1[1].HorizAxis:=aBothHorizAxis; Chart1[1].VertAxis:=aBothVertAxis; Chart1[2].CustomVertAxis:=MyAxis2; Chart1.Axes.Left.Title.Caption:='left axis title'; Chart1.Axes.Bottom.Title.Caption:='bottom axis title'; Chart1.Axes.Right.Title.Caption:='right axis title'; Chart1.Axes.Top.Title.Caption:='top axis title'; end; Hey Narcis, what about the problem described by Bert? The problem persists for (Angle=270 and not OtherSide) and (Angle=90 and OtherSide) Is this already fixed? Hi Johannes, Yes, it is. Please check your email. |