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
[SOLVED] FPSpreadSheet, ...
by
TRon
[
Today
at 01:25:51 am]
Is it possible to do git ...
by
TRon
[
Today
at 12:41:39 am]
Interesting article about...
by
Joanna from IRC
[
Today
at 12:41:28 am]
had a question and found ...
by
TRon
[
Today
at 12:36:57 am]
Draw Transparent Fill Rec...
by
LBox
[
Today
at 12:00:51 am]
Wiki, a dead link in page...
by
d7_2_laz
[December 09, 2024, 10:53:21 pm]
MIDI commands
by
TRon
[December 09, 2024, 10:43:22 pm]
Record "inheritance"/stru...
by
PascalDragon
[December 09, 2024, 10:31:25 pm]
Who catches the Linux sig...
by
LV
[December 09, 2024, 09:47:15 pm]
FreePascal version of gcc...
by
PascalDragon
[December 09, 2024, 09:45:02 pm]
Lazarus for Windows on aa...
by
PascalDragon
[December 09, 2024, 09:21:38 pm]
SAVE StringGrid to PDF
by
dseligo
[December 09, 2024, 07:42:30 pm]
ColorDialog can have opti...
by
Bart
[December 09, 2024, 06:07:24 pm]
Hustle - A simple task ma...
by
BSaidus
[December 09, 2024, 04:58:15 pm]
Notepad++ plugin with doc...
by
d7_2_laz
[December 09, 2024, 04:07:14 pm]
TLazSerial : serial port ...
by
CM630
[December 09, 2024, 04:05:20 pm]
MainMenu: How to use the ...
by
madref
[December 09, 2024, 03:39:05 pm]
Program running on after ...
by
MarkMLl
[December 09, 2024, 03:23:45 pm]
Array of String lookup gi...
by
jcmontherock
[December 09, 2024, 11:50:47 am]
The Silver Coder on YouTu...
by
silvercoder70
[December 09, 2024, 11:49:09 am]
Api/component pack for Ra...
by
cdbc
[December 09, 2024, 11:43:17 am]
How to know when dragging...
by
Aistis
[December 09, 2024, 10:41:22 am]
BASS DLL
by
d2010
[December 09, 2024, 07:47:33 am]
[Solved]Printing unicode ...
by
bobonwhidbey
[December 09, 2024, 05:23:56 am]
How to set the desktop co...
by
Fibonacci
[December 09, 2024, 02:42:15 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1704 times)
Curt Carpenter
Hero Member
Posts: 564
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: 12464
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