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
Lazarus Install PI5 Bookw...
by
paweld
[
Today
at 09:26:57 pm]
Anyone interested in test...
by
PascalDragon
[
Today
at 09:23:21 pm]
jwabcrypt unit is missing
by
PascalDragon
[
Today
at 09:21:00 pm]
Why cannot this be inline...
by
PascalDragon
[
Today
at 09:16:30 pm]
[SOLVED]Diferences in Gen...
by
janasoft
[
Today
at 09:05:14 pm]
Does using TTimer creates...
by
PascalDragon
[
Today
at 09:03:31 pm]
TPath enhancements (Issue...
by
qubits
[
Today
at 08:44:11 pm]
Lazarus corrupted my enti...
by
Martin_fr
[
Today
at 08:33:45 pm]
Projects written in old F...
by
wp
[
Today
at 08:07:11 pm]
TFileStream.ReadAnsiStrin...
by
Bart
[
Today
at 07:55:38 pm]
What is the meaning of TF...
by
Josh
[
Today
at 07:18:15 pm]
Adding an icon to the exe...
by
bobby100
[
Today
at 07:05:22 pm]
How to activate/show/focu...
by
Raumgleiter
[
Today
at 06:07:24 pm]
Does anybody have example...
by
pascalbythree
[
Today
at 06:01:21 pm]
Huge problem with open fi...
by
MarkMLl
[
Today
at 05:11:48 pm]
Get Started / How'to with...
by
circular
[
Today
at 05:08:32 pm]
GUI for ChatGPT (yarvis)
by
schuler
[
Today
at 04:40:13 pm]
Conscious Artificial Inte...
by
schuler
[
Today
at 04:37:48 pm]
[SOLVED] Simple (I hope) ...
by
SteveSS
[
Today
at 04:37:34 pm]
How to "create" a TFont a...
by
Hartmut
[
Today
at 04:36:13 pm]
Lazarus IDE Windows "stuc...
by
Tony Stone
[
Today
at 04:23:14 pm]
[SOLVED] TPanel slider po...
by
Pe3s
[
Today
at 04:20:03 pm]
Lazarus Release Candidate...
by
furious programming
[
Today
at 03:21:01 pm]
Faster code execution idi...
by
Martin_fr
[
Today
at 03:17:06 pm]
How to override the capti...
by
Joanna
[
Today
at 02:53:57 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 588 times)
Curt Carpenter
Sr. Member
Posts: 341
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: 11445
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