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
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
What am I missing here? [...
by
Handoko
[
Today
at 03:32:58 am]
Content is distorting / w...
by
jamie
[
Today
at 02:55:30 am]
AI Assist Python - to - P...
by
kirtu
[
Today
at 12:57:01 am]
Error with last fixes_3.2...
by
Fred vS
[
Today
at 12:51:51 am]
Which Control should I us...
by
Aruna
[
Today
at 12:34:15 am]
Instruction-level paralle...
by
LeP
[
Today
at 12:23:51 am]
Single and Double, Conver...
by
kupferstecher
[June 15, 2026, 10:56:53 pm]
Fpcupdeluxe
by
patyit
[June 15, 2026, 10:47:31 pm]
Lazarus syntax helpers
by
Edson
[June 15, 2026, 10:34:34 pm]
[New Component] ExtTabCtr...
by
wp
[June 15, 2026, 08:31:58 pm]
Can /my/ AI help me with ...
by
microxa
[June 15, 2026, 08:25:36 pm]
[ANN] PasBuild v1.9.0 Rel...
by
Graeme
[June 15, 2026, 08:14:26 pm]
If FileExists(
by
Remy Lebeau
[June 15, 2026, 07:58:06 pm]
Codepage issue in console...
by
Hartmut
[June 15, 2026, 07:52:43 pm]
Implementing an Elo ratin...
by
Warfley
[June 15, 2026, 06:33:56 pm]
[SOLVED]Program experienc...
by
Thaddy
[June 15, 2026, 05:39:33 pm]
RunFormula: math expressi...
by
stormray
[June 15, 2026, 03:30:10 pm]
Message CM_ShowingChanged...
by
AlexTP
[June 15, 2026, 01:21:03 pm]
MOVED: Eye Candy TESCheme
by
theo
[June 15, 2026, 10:06:43 am]
storing assets for releas...
by
Handoko
[June 15, 2026, 08:35:23 am]
TCHATGPT — An Artificial ...
by
marcelomaurinmartins@gmai
[June 15, 2026, 02:20:11 am]
Mundo Medieval 3D MMORPG ...
by
Rodrigo Robles
[June 14, 2026, 05:26:38 pm]
Fast Canvas Library V1.05...
by
Gigatron
[June 14, 2026, 04:57:35 pm]
SynEdit theme
by
LemonParty
[June 14, 2026, 02:01:33 pm]
What happened to CocoaWSC...
by
Frank
[June 14, 2026, 01:31:19 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 2161 times)
Curt Carpenter
Hero Member
Posts: 759
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: 13578
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