hi,
I can't make AdjustMaxMin and CalcMinMax for axis work. The first one doesn't resize the axis, the latter one doesn't give me the correct min max.
So normally how do I get the new min max after I changed the series value manually?
Automatic is false.
Thanks.
v7.06
what does AdjustMaxMin and CalcMinMax do?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Fang,
AdjustMaxMin:
This Axis method calculates Maximum and Minimum values based on Max and Min values of the dependent Series.
AdjustMaxMin is automatically called if Axis.Automatic is True.
The Chart UndoZoom method calls AdjustMaxMin for Left, Right,Top and Bottom axis.<
To set axes minimum and maximum values you should use SetMinMax mehtod.
CalcMinMax:
Returns the minimum and maximum values of the associated Series.
If this doesn't fit your needs you can use series MaxXValue, MinXValue, MaxYValue and MinYValue or Axes Minimum and Maximum properties.
AdjustMaxMin:
This Axis method calculates Maximum and Minimum values based on Max and Min values of the dependent Series.
AdjustMaxMin is automatically called if Axis.Automatic is True.
The Chart UndoZoom method calls AdjustMaxMin for Left, Right,Top and Bottom axis.<
To set axes minimum and maximum values you should use SetMinMax mehtod.
CalcMinMax:
Returns the minimum and maximum values of the associated Series.
If this doesn't fit your needs you can use series MaxXValue, MinXValue, MaxYValue and MinYValue or Axes Minimum and Maximum properties.
Best Regards,
Narcís Calvet / 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 |
Hi Fang,
using Axis automatic to False you should be able to use the AdjustMaxMin method using similar code like the following :
using Axis automatic to False you should be able to use the AdjustMaxMin method using similar code like the following :
Code: Select all
procedure AdjustAxis(Series: TChartSeries);
begin
if Assigned(Series) and Assigned(Series.GetHorizAxis) then
begin
Series.GetHorizAxis.SetMinMax(0,Series.Count-1);
Series.GetHorizAxis.AdjustMaxMin;
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Chart1.Repaint;
AdjustAxis(Series1);
end;
Pep Jorge
http://support.steema.com
http://support.steema.com