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
Battery Operations
by
Hansaplast
[
Today
at 04:26:54 pm]
CORDIC algorithms
by
Curt Carpenter
[
Today
at 04:23:32 pm]
TStringGrid with stretche...
by
Vodnik
[
Today
at 04:22:51 pm]
Unique Instance Terminate...
by
Weitentaaal
[
Today
at 04:17:43 pm]
[SOLVED] How to stay in t...
by
Hartmut
[
Today
at 04:14:16 pm]
Lazarus 3.9.9 Variable Wa...
by
Martin_fr
[
Today
at 03:55:01 pm]
How to convert Real to Bi...
by
kwyan
[
Today
at 03:41:14 pm]
Linux snapshot zip files ...
by
TRon
[
Today
at 03:30:03 pm]
Anyone interested in test...
by
Josh
[
Today
at 02:09:03 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]
lazarus controlling compi...
by
Bart
[
Today
at 11:33:03 am]
SVG thumbnails
by
domasz
[
Today
at 11:18:31 am]
i can't inatall Dam dialo...
by
TRon
[
Today
at 10:31:44 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]
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]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 749 times)
Curt Carpenter
Sr. Member
Posts: 342
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