Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
Tracking TChart cursor
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
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How to convert Real to Bi...
by
MathMan
[
Today
at 02:34:55 pm]
Anyone interested in test...
by
Josh
[
Today
at 02:09:03 pm]
Linux snapshot zip files ...
by
Zaher
[
Today
at 01:22:21 pm]
New version of BGRABitmap
by
lainz
[
Today
at 01:15:01 pm]
[SOLVED] TLabeledEdit.Edi...
by
jipété
[
Today
at 01:09:42 pm]
Automatize build system
by
Чебурашка
[
Today
at 12:20:44 pm]
How to stay in the invali...
by
wp
[
Today
at 11:50:39 am]
lazarus controlling compi...
by
Bart
[
Today
at 11:33:03 am]
SVG thumbnails
by
domasz
[
Today
at 11:18:31 am]
Unique Instance Terminate...
by
Thaddy
[
Today
at 10:34:09 am]
i can't inatall Dam dialo...
by
TRon
[
Today
at 10:31:44 am]
CORDIC algorithms
by
Thaddy
[
Today
at 10:20:40 am]
Autentication Oracle
by
Thaddy
[
Today
at 09:16:19 am]
How to "create" a TFont a...
by
kwyan
[
Today
at 04:29:00 am]
SOLVED How to get PRAGMA ...
by
JanRoza
[
Today
at 01:36:33 am]
Component writing adding ...
by
andrew Bubble
[
Today
at 12:01:02 am]
Compare strange character...
by
nikel
[December 05, 2023, 11:33:21 pm]
Lazarus Release Candidate...
by
dbannon
[December 05, 2023, 11:18:03 pm]
Question about glibc bug ...
by
PascalDragon
[December 05, 2023, 10:22:15 pm]
Virtual Method
by
PascalDragon
[December 05, 2023, 08:51:54 pm]
Lazarus 3.9.9 Variable Wa...
by
Martin_fr
[December 05, 2023, 08:48:26 pm]
Watchlist, order of the w...
by
Martin_fr
[December 05, 2023, 08:13:55 pm]
How to 'Hello world' on l...
by
FramX
[December 05, 2023, 07:39:07 pm]
Difference between TSpeed...
by
Hansvb
[December 05, 2023, 07:29:23 pm]
QT5 ide tooltips
by
zeljko
[December 05, 2023, 07:01:18 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 747 times)
Curt Carpenter
Sr. Member
Posts: 341
Tracking TChart cursor
«
on:
September 20, 2023, 06:07:58 pm »
A minimal example of how to track mouse cursor location on a TChart.
«
Last Edit: September 20, 2023, 06:50:06 pm by Curt Carpenter
»
Logged
wp
Hero Member
Posts: 11478
Re: Tracking TChart cursor
«
Reply #1 on:
September 20, 2023, 07:34:33 pm »
Yes, this works.
An idea for an extension: When you use a TDataPointCrossHairTool rather than a TUserDefinedTool you can utilize the fact that the mouse is caught near the data points and you can read out the exact values of the data points:
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
ChartToolset1DataPointCrosshairTool1Draw
(
ASender
:
TDataPointDrawTool
)
;
var
ser
:
TChartSeries
;
idx
:
Integer
;
begin
if
ASender <>
nil
then
begin
if
ASender
.
Series
<>
nil
then
begin
ser
:
=
ASender
.
Series
as TChartSeries
;
idx
:
=
ASender
.
PointIndex
;
Label3
.
Caption
:
=
'Series "'
+
ser
.
Title
+
'": x = '
+
ser
.
XValue
[
idx
]
.
ToString
+
' y = '
+
ser
.
YValue
[
idx
]
.
ToString
;
exit
;
end
;
Label3
.
Caption
:
=
''
;
end
;
end
;
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
Tracking TChart cursor
TinyPortal
© 2005-2018