delphi - TChart axis increment actual value -


i'm using tchart standard, version 8, , trying find actual tchartaxis.increment value. doc: "axis increment minimum step between axis labels... if there not enough space labels, tchart calculate bigger one". problem find appropriate minortickcount value, or rather coordinate actual increment. because default minorticks value (3) can looks strange if increment 5, instance (in case it's more natural have 5 minor ticks). thanks.

for instance, set increment 1 , minortickcount 0, tchart increases increment 5. if knew that, set minortickcount 4.

you can achieve calcincrement method, example:

uses series;  procedure tform1.formcreate(sender: tobject); begin   chart1.align:=alclient;   chart1.addseries(tlineseries).fillsamplevalues();    trackbar1.max:=10;   trackbar1.position:=2;  end;  procedure tform1.chart1afterdraw(sender: tobject); var tmpincr: double; begin   tmpincr:=chart1.axes.bottom.calcincrement;   if chart1.axes.bottom.minortickcount<>tmpincr-1   begin     chart1.axes.bottom.minortickcount:=trunc(tmpincr-1);     chart1.draw;   end; end;  procedure tform1.trackbar1change(sender: tobject); begin   chart1.axes.bottom.increment:=trackbar1.position;   label1.caption:='bottom axis increment: ' + inttostr(trackbar1.position); end; 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -