Page 1 of 1

Custom number of ticks

Posted: Wed Jul 27, 2005 12:46 pm
by 9339785
Hi,

How can I define the exact number of ticks on each axis ?
Example : 4 ticks on bottom axis, and 4 minor-ticks between each ticks.

Thanks
Franck

Posted: Wed Jul 27, 2005 12:55 pm
by narcis
Hi Franck,

The number of ticks will be determined by the combination of axis Minimum and Maximum properties values and Increment property value. The number of minor ticks can be set using MinorTickCount property.

In the snippet below you'll have 5 ticks (at 0, 5, 10, 15 and 20 positions) and 2 minor ticks between each tick.

Code: Select all

  With Chart1.Axes.Bottom do
  begin
    SetMinMax(0,20);
    Increment:=5;
    MinorTickCount:=2;
  end;