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
i can't inatall Dam dialo...
by
majid.ebru
[
Today
at 05:24:36 am]
[SOLVED] TFPHTTPClient.Ge...
by
lebao3105
[
Today
at 05:24:06 am]
Dynamical creation of obj...
by
jmpessoa
[
Today
at 04:54:09 am]
Lazarus Release Candidate...
by
dbannon
[
Today
at 04:50:07 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 04:37:17 am]
Not able to add any compo...
by
TRon
[
Today
at 03:28:14 am]
Can TreeView Node Colours...
by
wp
[
Today
at 01:08:11 am]
TAnchorDockPanel - Save a...
by
kapibara
[
Today
at 01:07:22 am]
Run time error 3162112
by
TRon
[
Today
at 12:42:08 am]
Absolute positioning of c...
by
jmpessoa
[
Today
at 12:23:03 am]
Fpcupdeluxe
by
Tony Stone
[December 01, 2023, 11:56:54 pm]
Has anyone used Free Pasc...
by
schuler
[December 01, 2023, 11:21:03 pm]
GUI for ChatGPT (yarvis)
by
schuler
[December 01, 2023, 11:07:43 pm]
Why cannot this be inline...
by
PascalDragon
[December 01, 2023, 10:29:01 pm]
TPath enhancements (Issue...
by
PascalDragon
[December 01, 2023, 10:12:16 pm]
Sleep forever
by
PascalDragon
[December 01, 2023, 09:57:47 pm]
Improvement for TFPHTTPCo...
by
PascalDragon
[December 01, 2023, 09:47:43 pm]
[SOLVED] Titlebar custom ...
by
Pe3s
[December 01, 2023, 09:25:41 pm]
Finding Zen GL C librarie...
by
Seenkao
[December 01, 2023, 08:30:51 pm]
Any library to generate a...
by
Kurt
[December 01, 2023, 08:15:15 pm]
How to print a DrawGrid
by
paweld
[December 01, 2023, 07:08:06 pm]
Winsoft libraries
by
domasz
[December 01, 2023, 06:48:40 pm]
Masking password entry in...
by
imperiusdamian
[December 01, 2023, 05:02:58 pm]
What is the meaning of TF...
by
kwyan
[December 01, 2023, 04:45:14 pm]
Something like 'fpcupdelu...
by
avra
[December 01, 2023, 04:23:11 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 654 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: 11447
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