Axis on X=1 and Y=1?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Matheo Soft.
Newbie
Newbie
Posts: 21
Joined: Tue Oct 04, 2011 12:00 am

Axis on X=1 and Y=1?

Post by Matheo Soft. » Mon Oct 10, 2011 5:50 pm

Dear Support,

On Delphi7.

Is it possible to have the intersect axis X Y to the coordonates XY(1,1) ?

My X-axis is logarithmic and Y-axis is variable, so I can't set 50% i.e.

Many thank for your help,
Bruno

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

Re: Axis on X=1 and Y=1?

Post by Yeray » Tue Oct 11, 2011 10:58 am

Hello Bruno,

You could calculate the position of the value 1 each time the chart is repainted (because it will vary if you scroll/zoom the chart) and use it as follows:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  Chart1.Axes.Left.PositionUnits:=muPixels;
  Chart1.Axes.Left.PositionPercent:=Chart1.Axes.Bottom.CalcPosValue(1) - Chart1.ChartRect.Left;

  Chart1.Axes.Bottom.PositionUnits:=muPixels;
  Chart1.Axes.Bottom.PositionPercent:=Chart1.ChartRect.Bottom - Chart1.Axes.Left.CalcPosValue(1);
end;
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

Matheo Soft.
Newbie
Newbie
Posts: 21
Joined: Tue Oct 04, 2011 12:00 am

Re: Axis on X=1 and Y=1?

Post by Matheo Soft. » Tue Oct 11, 2011 11:30 am

Hello Yeray,

Thanks a lot for your answer but I have a little program now, I need to see 3 times the graph (Tbubblechart) to see X-Y axis at the right point.

My chart is on a Pagecontrol, I need to switch 3 times (from another page to chart page) to see the XYAxis in the right position (1, 1)
Each switch, the Axis approaches to the right position.

I need to draw the chart one more time?

What I missed?

Matheo Soft.
Newbie
Newbie
Posts: 21
Joined: Tue Oct 04, 2011 12:00 am

Re: Axis on X=1 and Y=1?

Post by Matheo Soft. » Tue Oct 11, 2011 11:32 am

sorry :
"...but I have a little program now..."

"...but I have a little problem now..."

Matheo Soft.
Newbie
Newbie
Posts: 21
Joined: Tue Oct 04, 2011 12:00 am

Re: Axis on X=1 and Y=1?

Post by Matheo Soft. » Tue Oct 11, 2011 11:45 am

Another thing, sorry,

If I resize my PageControl (tabsheet) XY axis positions are not recalculate :'(

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

Re: Axis on X=1 and Y=1?

Post by Yeray » Tue Oct 11, 2011 3:15 pm

Hello Bruno,

Yes, you probably need to recalculate the positions of the axis or to force the chart to be redrawn (Chart1.Draw call) using the events you need.
If you can arrange a simple example project we can run as-is to reproduce your situation here, we'll be pleased to take a look at it and try to suggest you a more concrete solution.
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