Page 1 of 1

Axis on X=1 and Y=1?

Posted: Mon Oct 10, 2011 5:50 pm
by 16560339
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

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

Posted: Tue Oct 11, 2011 10:58 am
by yeray
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;

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

Posted: Tue Oct 11, 2011 11:30 am
by 16560339
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?

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

Posted: Tue Oct 11, 2011 11:32 am
by 16560339
sorry :
"...but I have a little program now..."

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

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

Posted: Tue Oct 11, 2011 11:45 am
by 16560339
Another thing, sorry,

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

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

Posted: Tue Oct 11, 2011 3:15 pm
by yeray
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.