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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
TSynCompletion filtering ...
by
Wesbat
[December 14, 2024, 10:44:41 pm]
How make the GUI as one p...
by
dsiders
[December 14, 2024, 10:40:29 pm]
Current GTK2 and GTK3 Sta...
by
dsiders
[December 14, 2024, 10:34:47 pm]
Starting a program with h...
by
jeremiah
[December 14, 2024, 10:02:03 pm]
AVRPascal – free code edi...
by
ackarwow
[December 14, 2024, 10:00:42 pm]
Button opens terminal (Li...
by
MarkMLl
[December 14, 2024, 09:36:48 pm]
Animated GIF's and Lazaru...
by
Aruna
[December 14, 2024, 09:31:37 pm]
How to copy file to web
by
bobonwhidbey
[December 14, 2024, 09:20:16 pm]
Interesting article about...
by
440bx
[December 14, 2024, 08:58:24 pm]
[Solved] Q: Debug a plugi...
by
d7_2_laz
[December 14, 2024, 08:10:13 pm]
[Solved] TCheckGroup Chil...
by
TheLastCayen
[December 14, 2024, 07:43:50 pm]
NSHapticFeedbackPerformer
by
msintle
[December 14, 2024, 07:35:29 pm]
Another way to search the...
by
Handoko
[December 14, 2024, 07:24:17 pm]
SDL2 Fit image rotation b...
by
Pe3s
[December 14, 2024, 07:18:57 pm]
SAVE StringGrid to PDF
by
dseligo
[December 14, 2024, 06:50:20 pm]
Error: External: FLT INVA...
by
krzynio
[December 14, 2024, 06:23:56 pm]
Specializing a generic of...
by
Okoba
[December 14, 2024, 05:26:07 pm]
[SOLVED] Classic objects ...
by
flowCRANE
[December 14, 2024, 05:25:15 pm]
C operators and shift
by
VisualLab
[December 14, 2024, 05:20:20 pm]
Lazarus for Windows on aa...
by
PascalDragon
[December 14, 2024, 03:32:02 pm]
Common File Dialogs Have ...
by
rvk
[December 14, 2024, 02:39:17 pm]
DBGrid editing control
by
silvercoder70
[December 14, 2024, 12:43:29 pm]
IFS Fractals: Iterating t...
by
Joanna from IRC
[December 14, 2024, 11:41:26 am]
Unwanted additional line ...
by
CM630
[December 14, 2024, 08:55:13 am]
MainMenu: How to use the ...
by
rich2014
[December 14, 2024, 02:45:31 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1708 times)
Curt Carpenter
Hero Member
Posts: 567
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: 12476
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