Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
minimum interval [SOLVED]
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Fast Canvas Library V1.05...
by
backprop
[
Today
at 08:22:41 pm]
Dumping preprocessed work...
by
Чебурашка
[
Today
at 08:21:07 pm]
Lazaris IDE v4.4 - extrem...
by
CM630
[
Today
at 08:10:36 pm]
How to determine the unkn...
by
CM630
[
Today
at 08:06:39 pm]
Pre-Specialize Generic Fu...
by
MMarie
[
Today
at 08:04:53 pm]
Change colors for Code Ex...
by
TBMan
[
Today
at 07:37:40 pm]
Can we wallgarden this, p...
by
Mobius1
[
Today
at 07:21:06 pm]
Testers needed - Skip met...
by
Martin_fr
[
Today
at 05:10:28 pm]
FPC and Lazarus coding st...
by
Curt Carpenter
[
Today
at 04:10:03 pm]
ThorVG - test (lightweigh...
by
LeP
[
Today
at 04:00:06 pm]
Star Trek playing cards a...
by
TBMan
[
Today
at 03:57:58 pm]
Status of FPC 3.4.0 or FP...
by
Martin_fr
[
Today
at 11:44:46 am]
Here's how to show colour...
by
Pallzi
[
Today
at 11:19:27 am]
Transparent Form: Done di...
by
LV
[
Today
at 08:38:31 am]
Lazarus for Windows on aa...
by
msintle
[
Today
at 02:29:50 am]
it2play - IT/S3M module r...
by
hukka
[
Today
at 01:02:01 am]
Debian removes FPC/Lazaru...
by
dbannon
[
Today
at 12:57:16 am]
Rolling releases Lazarus[...
by
dbannon
[
Today
at 12:44:27 am]
GridPrinter requirements ...
by
sfeinst
[
Today
at 12:39:07 am]
Lazarus programs look ugl...
by
the_magik_mushroom
[February 07, 2026, 11:54:12 pm]
LCL Web Native with D2Bri...
by
xinyiman
[February 07, 2026, 10:43:41 pm]
Recommendations for wasm3...
by
PascalDragon
[February 07, 2026, 10:38:15 pm]
Migrating SK1 Project to ...
by
jamie
[February 07, 2026, 09:13:45 pm]
[SOLVED] The main screen ...
by
Hansvb
[February 07, 2026, 06:50:52 pm]
[SOLVED] Don't find the U...
by
Hartmut
[February 07, 2026, 05:23:36 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: minimum interval [SOLVED] (Read 1696 times)
bbd666
New Member
Posts: 42
minimum interval [SOLVED]
«
on:
February 27, 2024, 03:43:25 pm »
Hi all,
How to set a minimum value for the bottomaxis interval ?
For instance I want my chart to display intervals no lower than 1.
Thks for any reply.
«
Last Edit: February 28, 2024, 10:38:45 am by bbd666
»
Logged
wp
Hero Member
Posts: 13350
Re: minimum interval
«
Reply #1 on:
February 27, 2024, 04:12:20 pm »
In Laz 3.0, the axis
Intervals.Options
have a new element,
apiInteger
. When you add this, only integer values will be allowed for axis labels.
Logged
bbd666
New Member
Posts: 42
Re: minimum interval
«
Reply #2 on:
February 27, 2024, 04:22:02 pm »
thks for your anwer
I'm using Laz v2.2.4
is it possible to upgrade with no loss in terms of configuation (packages and so on) ?
Logged
wp
Hero Member
Posts: 13350
Re: minimum interval
«
Reply #3 on:
February 27, 2024, 04:47:10 pm »
Depending whether your Lazarus source files are in a directory to which you can write this can be easy - or difficult. I looked at the git changelog when this feature was introduced, and you can easily make the following changes (if you are allowed to modify the source files):
Go to folder
components/tachart
of your Lazarus installation
Open file
taintervalsources.pas
in the IDE or an external editor
Scroll down to the implementation of procedure
TIntervalChartSource.CalculateIntervals
Add the following highlighted code between the lines "bestCount := 0" and "if aipUseNiceSteps in Params.Options"
Code: Pascal
[Select]
[+]
[-]
var
minCount
,
maxCount
,
bestCount
:
Integer
;
s
,
sv
:
Double
;
begin
CalcMinMaxCount
(
minCount
,
maxCount
)
;
bestCount
:
=
0
;
if
aipInteger
in
Params
.
Options
then
begin
ABestStart
:
=
Int
(
AParams
.
FMin
)
;
ABestStep
:
=
1.0
;
bestCount
:
=
Round
(
AParams
.
FMax
)
-
round
(
ABestStart
)
;
if
bestCount <
=
maxCount
then
exit
;
end
;
if
aipUseNiceSteps
in
Params
.
Options
then
begin
[
...
]
Save
Now open the unit
tacustomsource.pas
.
Near the top there is the type declaration of
TAxisIntervalParamOption
.
Before the closing bracket, add
aipInteger
. The entire type declaration now should be
Code: Pascal
[Select]
[+]
[-]
type
TAxisIntervalParamOption
=
(
aipGraphCoords
,
aipUseCount
,
aipUseMaxLength
,
aipUseMinLength
,
aipUseNiceSteps
,
aipInteger
)
;
Save
Now
recompile the IDE
: In Lazarus, go to "Tools" > "Build Lazarus with profile ...". After a while the IDE restarts and you should be ready to go.
Since there is always a chance that I forgot something so that the patch cannot be compiled with your version absolutely make a backup copy of the to-be-changed files before starting.
Logged
bbd666
New Member
Posts: 42
Re: minimum interval
«
Reply #4 on:
February 27, 2024, 05:22:24 pm »
Great ! I'll try this.
Thks so much
Logged
bbd666
New Member
Posts: 42
Re: minimum interval
«
Reply #5 on:
February 28, 2024, 10:38:02 am »
That works fine !!!
Thank you very much, your instructions were crystal clear.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
minimum interval [SOLVED]
TinyPortal
© 2005-2018