How can I tell different series to use the same X (Bottom) Axis ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
axrDegen
Newbie
Newbie
Posts: 31
Joined: Mon Jan 14, 2019 12:00 am

How can I tell different series to use the same X (Bottom) Axis ?

Post by axrDegen » Sun Mar 10, 2019 4:49 pm

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
BottomAxisCapture.PNG (57.2 KiB) Viewed 12347 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,

axrDegen
Newbie
Newbie
Posts: 31
Joined: Mon Jan 14, 2019 12:00 am

Re: How can I tell different series to use the same X (Bottom) Axis ?

Post by axrDegen » Mon Mar 11, 2019 2:11 pm

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 ?

axrDegen
Newbie
Newbie
Posts: 31
Joined: Mon Jan 14, 2019 12:00 am

Re: How can I tell different series to use the same X (Bottom) Axis ?

Post by axrDegen » Mon Mar 11, 2019 2:33 pm

Attached an example project that shows that the Labels are displayed on the X axis instead of the X values given for the Bubbles
Attachments
LabelInsteadofNumbersOnXAxis.zip
(54.12 KiB) Downloaded 698 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: How can I tell different series to use the same X (Bottom) Axis ?

Post by Christopher » Tue Mar 12, 2019 11:46 am

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
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

axrDegen
Newbie
Newbie
Posts: 31
Joined: Mon Jan 14, 2019 12:00 am

Re: How can I tell different series to use the same X (Bottom) Axis ?

Post by axrDegen » Tue Mar 12, 2019 12:56 pm

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

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How can I tell different series to use the same X (Bottom) Axis ?

Post by Yeray » Mon Mar 18, 2019 11:09 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply