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
SAVE StringGrid to PDF
by
jianwt
[
Today
at 01:41:29 am]
Interesting article about...
by
Joanna from IRC
[
Today
at 01:21:28 am]
had a question and found ...
by
MarkMLl
[
Today
at 12:13:40 am]
DBLookupListBox shows (ME...
by
Sieben
[December 10, 2024, 11:10:25 pm]
Random errors in TensorFl...
by
TRon
[December 10, 2024, 11:02:08 pm]
Online tutor using remote...
by
silvercoder70
[December 10, 2024, 10:04:11 pm]
how to control the order ...
by
mas steindorff
[December 10, 2024, 08:47:04 pm]
Wiki, a dead link in page...
by
d7_2_laz
[December 10, 2024, 08:42:35 pm]
How to save a Graphic fro...
by
jeremiah
[December 10, 2024, 08:11:54 pm]
Crosshair error when chan...
by
Marq01
[December 10, 2024, 08:02:17 pm]
Adding interfaces to any ...
by
Thaddy
[December 10, 2024, 07:32:56 pm]
AVRPascal – free code edi...
by
ackarwow
[December 10, 2024, 04:57:47 pm]
MainMenu: How to use the ...
by
madref
[December 10, 2024, 04:19:32 pm]
I need advice for a new c...
by
wp
[December 10, 2024, 03:18:11 pm]
Controlled Folder Access
by
Igor Kokarev
[December 10, 2024, 02:17:46 pm]
Datatypes Interoperabilit...
by
silvercoder70
[December 10, 2024, 01:32:48 pm]
Notepad++ plugin with doc...
by
d7_2_laz
[December 10, 2024, 01:11:52 pm]
ZDataset.Locate + loParti...
by
silvercoder70
[December 10, 2024, 10:49:08 am]
SQLite3 Date Problem
by
silvercoder70
[December 10, 2024, 10:08:07 am]
Record "inheritance"/stru...
by
Thaddy
[December 10, 2024, 09:54:38 am]
D2Bridge Framework for La...
by
egsuh
[December 10, 2024, 04:48:02 am]
Application deployment
by
cousinp
[December 10, 2024, 04:28:36 am]
[SOLVED] FPSpreadSheet, ...
by
TRon
[December 10, 2024, 01:25:51 am]
Is it possible to do git ...
by
TRon
[December 10, 2024, 12:41:39 am]
Draw Transparent Fill Rec...
by
LBox
[December 10, 2024, 12:00:51 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1705 times)
Curt Carpenter
Hero Member
Posts: 566
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: 12466
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