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 1288

Summary: SubAxes only position correctly after mousemove across chart
Product: VCL TeeChart Reporter: christopher ireland <chris>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: normal CC: marc
Priority: High    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description christopher ireland 2015-09-03 07:46:25 EDT
Reproducible using the following code:

procedure TForm1.InitializeChart;
var tmpS : TBarSeries;
    subA : TChartAxis;
begin
   Chart1.View3D:=false;

   tmpS := TBarSeries(Chart1.AddSeries(TBarSeries));
   tmpS.FillSampleValues();


   subA:=Chart1.Axes.Left.SubAxes.Add;
   subA.Increment:=500/3;
end;
Comment 1 marc meumann 2016-10-17 11:06:06 EDT
Axis can only calculate location with respect to Label text width (or height) after the paint has cycled once. For sub Axes we recommend taking the size from the parent axis.

eg.

procedure TForm1.InitializeChart;
var tmpS : TBarSeries;
    subA : TChartAxis;
begin
   Chart1.View3D:=false;

   tmpS := TBarSeries(Chart1.AddSeries(TBarSeries));
   tmpS.FillSampleValues();


   subA:=Chart1.Axes.Left.SubAxes.Add;
   subA.Increment:=500/3;

   subA.LabelsSize := Chart1.Axes.Left.MaxLabelsWidth;  //<- here
end;