I have a requirement for multiple left axis with associated series with the user able to select which Axis and Series are to be shown.
To do this I implemented multiple Custom Axis with their associated series.
The problem is that if only custom axes are being displayed then I am unable to adjust or even under default conditions (LabelSize and TitleSize set to 0) get all the left axis labels and titles to show.
I have reduced this issue to
1. Create new project
2. Add TChart
3. Add the following code to be called from the forms constructor.
Code: Select all
procedure TfrmPondLevelTest.SetupChart;
var
newSeries: TLineSeries;
customAxis: TChartAxis;
begin
Chart.ClearChart;
Chart.View3D := False;
Chart.Legend.Visible := False;
// Create new series
newSeries := TLineSeries.Create(Chart);
Chart.AddSeries(newSeries);
newSeries.Title := 'SERIES TITLE';
if False then
begin
// Series uses left axis
Chart.LeftAxis.Title.Caption := 'LEFT AXIS';
Chart.LeftAxis.LabelsSize := 25;
Chart.LeftAxis.TitleSize := 25;
end;
if True then
begin
// Series uses Custom Axis
customAxis := TChartAxis.Create(Chart.CustomAxes);
customAxis.Title.Caption := 'CUSTOM AXIS';
newSeries.CustomVertAxis := customAxis;
customAxis.LabelsSize := 25;
customAxis.TitleSize := 25;
end;
newSeries.FillSampleValues(20);
end;
I would expect to get the same result in both cases but I am not and I cannot figure out how to get the custom axis to behave the same as the Left Axis.
Any help would be appreciated.