Page 1 of 1
How can I tell different series to use the same X (Bottom) Axis ?
Posted: Sun Mar 10, 2019 4:49 pm
by 16585377
Hello,
I have created a Chart with a couple of "TBubbleSeries"
Each BubbleSeries has its own color.
In call "AddBubble" I add individual X and Y values.
That produces a Chart with multiple/overlaid bottom axis:
- BottomAxisCapture.PNG (57.2 KiB) Viewed 13185 times
How can I prevent that, how can I make sure all the bubble
seris are using the same bottom axis ?
Thanks and best regards,
Re: How can I tell different series to use the same X (Bottom) Axis ?
Posted: Mon Mar 11, 2019 2:11 pm
by 16585377
Oh, I just see, this confusion on the X (bottom) axis happens when I supply Labels in call TBubbleSeries.AddBubble().
Why are the labels displayed on the X axis ?
Re: How can I tell different series to use the same X (Bottom) Axis ?
Posted: Mon Mar 11, 2019 2:33 pm
by 16585377
Attached an example project that shows that the Labels are displayed on the X axis instead of the X values given for the Bubbles
Re: How can I tell different series to use the same X (Bottom) Axis ?
Posted: Tue Mar 12, 2019 11:46 am
by Christopher
Hello!
The extra line in the code snippet below will force the xaxis labels to render the values of the points and not their labels. By default, the LabelStyle property is set to talAuto which will render the xaxis labels as the string labels of the points.
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
const
BubbleSizeC = 0.15;
var
i: Integer;
begin
try
AllOptimizationChart.Axes.Bottom.LabelStyle:=TAxisLabelStyle.talValue; //newline
for i := 0 to AllOptimizationChart.SeriesList.Count - 1 do
AllOptimizationChart.Series[i].BeginUpdate;
try
Re: How can I tell different series to use the same X (Bottom) Axis ?
Posted: Tue Mar 12, 2019 12:56 pm
by 16585377
Hello Christopher,
thank you, I just found out myself too by changing/trying almost any property in the paged dialog.
Isn't that a quite strange Default?
I would expect "TAxisLabelStyle.talValue" to be the Default.
thanks and best regards
Re: How can I tell different series to use the same X (Bottom) Axis ?
Posted: Mon Mar 18, 2019 11:09 am
by yeray
Hello,
That's will probably depend on the case. Some people argues that, once you have labels in a series, they'd expect them to be shown in the axis.