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
GTK3 is now the default w...
by
dbannon
[
Today
at 03:25:30 am]
Parsing error?
by
jlinux
[
Today
at 02:15:42 am]
FPC Unleashed (async/awai...
by
Fibonacci
[
Today
at 12:45:09 am]
Windows Installer with FP...
by
Martin_fr
[
Today
at 12:32:53 am]
Putting a new file on a w...
by
J-G
[July 18, 2026, 11:10:43 pm]
[SOLVED]Problem with Mari...
by
Tomu
[July 18, 2026, 10:49:15 pm]
debugger error
by
Martin_fr
[July 18, 2026, 10:38:42 pm]
TCHATGPT — An Artificial ...
by
schuler
[July 18, 2026, 10:00:48 pm]
Which quantized model wor...
by
schuler
[July 18, 2026, 09:45:50 pm]
Slow app start on M5 MacB...
by
Thaddy
[July 18, 2026, 08:16:52 pm]
Peculiarities in the EXE ...
by
Thaddy
[July 18, 2026, 07:49:45 pm]
Windows 2026_7 update and...
by
Martin_fr
[July 18, 2026, 06:23:32 pm]
KOL4 Beta available.
by
Thaddy
[July 18, 2026, 06:23:08 pm]
This week in OPM!
by
wp
[July 18, 2026, 01:59:33 pm]
FastCGI vs. CGI
by
Thaddy
[July 18, 2026, 01:32:45 pm]
Testing Antropic
by
Tomxe
[July 18, 2026, 12:46:14 pm]
authentiacte through goog...
by
Thaddy
[July 18, 2026, 09:12:56 am]
[SOLVED] Stopped compilin...
by
CM630
[July 18, 2026, 08:41:58 am]
[CLOSED] Seeking performa...
by
Xenno
[July 18, 2026, 08:11:26 am]
Lazarus Main not building...
by
Thaddy
[July 18, 2026, 06:31:42 am]
Setting the CURSOR for th...
by
jamie
[July 18, 2026, 02:16:55 am]
TPeriodicTable
by
wp
[July 18, 2026, 12:19:25 am]
I have made some progress...
by
onionmixer
[July 17, 2026, 08:08:34 pm]
How to connect to MariaDb...
by
jcmontherock
[July 17, 2026, 06:23:38 pm]
Accessing VRAM memory wit...
by
LemonParty
[July 17, 2026, 04:45:30 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: minimum interval [SOLVED] (Read 1849 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: 13630
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: 13630
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