Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TChart: Setting maximum and minimum values for y-axis

2,416 views
Skip to first unread message

Rolf Fankhauser

unread,
Oct 18, 2000, 3:00:00 AM10/18/00
to
The default maximum and minimum values automatically chosen by TChart
are too close to the maximum and minimum of the series values, so that
sometimes series lines parallel to minimum and maximum are not visible
in the chart. Therefore I want to make maximum and minimum a little bit
larger with the following event handler:


with LeftAxis do
begin
Automatic := false;
AdjustMaxMin;
Maximum := Maximum + 0.01*(Maximum - Minimum);
Minimum := Minimum - 0.01*(Maximum - Minimum);
end;

I create all chart dynamically, so I would like to assign an event
handler to an event which is fired when the chart is shown (.Show) or
brought to front (.BringToFront), but there are no corresponding event
handlers.

Thanks in advance for any help.

Kind regards,

Rolf

--
----------------------------------------------------------------
Rolf Fankhauser, PhD
ETHZ - Federal Institute of Technology Zurich
Institute of Hydromechanics and Water Resources Management
Urban Water Management Division
HIL G 31.3
CH-8093 Zuerich-Hoenggerberg
Switzerland
Tel. +41-1-633 25 07
Fax. +41-1-633 10 61

Paul Cerna

unread,
Oct 18, 2000, 3:00:00 AM10/18/00
to
You can "move" the min and max values away from the edges without having to
alter the min/max computation:
in the design time editor, go to the Axis tab, Position. In there, you will
find "Start %" and "End %". I set mine to 1 and 99, the 1 % margin is enough
to make the min and max values visible in my charts. This way I do not have
to worry about Minimum and Maximum during zooming, unzooming, etc.

Paul Cerna.

"Rolf Fankhauser" <fankh...@eawag.ch> wrote in message
news:39EDB82B...@eawag.ch...

Rolf Fankhauser

unread,
Oct 18, 2000, 3:00:00 AM10/18/00
to
Thanks a lot for your hint but during design time I have no access to the charts
because I create all of them during run time. So I should know which properties
can do this during run time. Then I can add these setting in the chart creation
method or in an event handler.

Kind regards,

Rolf

Rolf Fankhauser

unread,
Oct 18, 2000, 3:00:00 AM10/18/00
to
I found the properties: LeftAxis.StartPosition := 1; LeftAxis.EndPosition := 99;
This works perfectly!

Rolf

0 new messages