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
Minor Q: HowTo use 'Debug...
by
d7_2_laz
[
Today
at 10:25:21 pm]
Resolving procedure symbo...
by
MarkMLl
[
Today
at 10:08:15 pm]
D2Bridge Framework for La...
by
nummer8
[
Today
at 09:38:44 pm]
How do you maintain your ...
by
MarkMLl
[
Today
at 09:20:55 pm]
Time & Billing Accounting...
by
1HuntnMan
[
Today
at 09:14:09 pm]
Run ffmpeg via TProcess
by
HobbyDev
[
Today
at 08:51:52 pm]
IContainers
by
cdbc
[
Today
at 07:28:18 pm]
fpc trunk:I can't build i...
by
zoltanleo
[
Today
at 07:09:08 pm]
Loading TIFF Files in Bgr...
by
wp
[
Today
at 05:51:54 pm]
Does not suggest function...
by
WooBean
[
Today
at 05:40:56 pm]
[SOLVED] using TForm.OnPa...
by
Remy Lebeau
[
Today
at 05:34:54 pm]
My first "tool" written w...
by
TBMan
[
Today
at 05:28:10 pm]
No access to the wiki
by
Thaddy
[
Today
at 04:55:31 pm]
UK's Online Safety Act
by
LV
[
Today
at 04:54:10 pm]
Error 403 downloading wit...
by
Thaddy
[
Today
at 03:29:23 pm]
Preparing FPC 3.2.4, poin...
by
Thaddy
[
Today
at 02:32:36 pm]
Select cell in listview /...
by
Jonny
[
Today
at 02:32:19 pm]
Post your artwork made fr...
by
circular
[
Today
at 12:41:24 pm]
[SOLVED] SetPart ?
by
circular
[
Today
at 12:28:21 pm]
Does unit recompilation r...
by
cdbc
[
Today
at 11:48:20 am]
Compile on multiple distr...
by
dbannon
[
Today
at 09:28:37 am]
Intricate LSystem Snowfla...
by
Boleeman
[
Today
at 07:59:07 am]
[SOLVED] How to add new ...
by
eolandro
[
Today
at 03:39:09 am]
BGRA Controls
by
lainz
[
Today
at 03:22:52 am]
color for selected cells
by
kjteng
[
Today
at 02:50:42 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1769 times)
Curt Carpenter
Hero Member
Posts: 577
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: 12525
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