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
Noting responds when send...
by
Hartmut
[
Today
at 03:11:11 pm]
i can't inatall Dam dialo...
by
majid.ebru
[
Today
at 02:55:58 pm]
how to change color of a ...
by
DreamVB
[
Today
at 02:45:35 pm]
Winsoft libraries
by
Dzandaa
[
Today
at 02:43:05 pm]
Titlebar custom color
by
domasz
[
Today
at 02:38:50 pm]
What is the meaning of TF...
by
Hartmut
[
Today
at 02:38:06 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]
Improvement for TFPHTTPCo...
by
domasz
[
Today
at 12:34:11 pm]
Mediators and Indexed Pro...
by
Zvoni
[
Today
at 10:37:35 am]
TProcess and lots of data...
by
domasz
[
Today
at 10:33:32 am]
Столбец из CSV в CheckLis...
by
Red_prig
[
Today
at 08:40:50 am]
GetExceptionMask - Thread...
by
upsidasi
[
Today
at 08:33:55 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 05:19:05 am]
TFPHTTPClient.Get(URL) / ...
by
dseligo
[
Today
at 05:03:08 am]
FPC Compiler Relocation B...
by
Coldzer0
[
Today
at 04:53:42 am]
[SOLVED] Problems with ac...
by
Gercino
[
Today
at 01:04:30 am]
[SOLVED] TLabel OptimalFi...
by
Josh
[November 30, 2023, 11:43:45 pm]
Not able to add any compo...
by
andrew Bubble
[November 30, 2023, 11:41:01 pm]
Pascal script: Unable to ...
by
aducom
[November 30, 2023, 10:13:42 pm]
Lazarus Release Candidate...
by
AlexTP
[November 30, 2023, 10:01:08 pm]
Dynamical creation of obj...
by
peterbos
[November 30, 2023, 09:10:55 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 639 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: 11445
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