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
Can TreeView Node Colours...
by
wp
[
Today
at 10:46:31 pm]
Not able to add any compo...
by
dseligo
[
Today
at 10:44:20 pm]
Why cannot this be inline...
by
PascalDragon
[
Today
at 10:29:01 pm]
TPath enhancements (Issue...
by
PascalDragon
[
Today
at 10:12:16 pm]
Sleep forever
by
PascalDragon
[
Today
at 09:57:47 pm]
Improvement for TFPHTTPCo...
by
PascalDragon
[
Today
at 09:47:43 pm]
[SOLVED] Titlebar custom ...
by
Pe3s
[
Today
at 09:25:41 pm]
Un-register an LCL Compon...
by
JuhaManninen
[
Today
at 09:19:48 pm]
TFPHTTPClient.Get(URL) / ...
by
dseligo
[
Today
at 09:14:00 pm]
i can't inatall Dam dialo...
by
tetrastes
[
Today
at 08:36:29 pm]
Finding Zen GL C librarie...
by
Seenkao
[
Today
at 08:30:51 pm]
Any library to generate a...
by
Kurt
[
Today
at 08:15:15 pm]
How to print a DrawGrid
by
paweld
[
Today
at 07:08:06 pm]
Winsoft libraries
by
domasz
[
Today
at 06:48:40 pm]
Lazarus Release Candidate...
by
dedrasta
[
Today
at 06:17:59 pm]
Masking password entry in...
by
imperiusdamian
[
Today
at 05:02:58 pm]
What is the meaning of TF...
by
kwyan
[
Today
at 04:45:14 pm]
Something like 'fpcupdelu...
by
avra
[
Today
at 04:23:11 pm]
Noting responds when send...
by
Hartmut
[
Today
at 03:11:11 pm]
how to change color of a ...
by
DreamVB
[
Today
at 02:45:35 pm]
TWSButton descendance
by
lagprogramming
[
Today
at 02:29:19 pm]
Out of memory on a ATtiny...
by
Thaddy
[
Today
at 01:59:12 pm]
AI cheetah
by
dseligo
[
Today
at 01:46:38 pm]
Anyone interested in test...
by
ad1mt
[
Today
at 01:12:48 pm]
Error: Can't create obje...
by
BubikolRamios
[
Today
at 12:53:39 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 646 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: 11446
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