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
[SOLVED] TStringGrid.Colu...
by
dsiders
[
Today
at 02:43:12 am]
Creating a "compressed" s...
by
maurobio
[December 03, 2023, 11:19:01 pm]
Advance Record operators ...
by
Zoran
[December 03, 2023, 11:03:39 pm]
i can't inatall Dam dialo...
by
jamie
[December 03, 2023, 10:54:42 pm]
Lazarus 3.9.9 Variable Wa...
by
Martin_fr
[December 03, 2023, 09:27:11 pm]
Installing Lazarus on a R...
by
JuhaManninen
[December 03, 2023, 09:09:05 pm]
Lazarus Release Candidate...
by
af0815
[December 03, 2023, 08:34:01 pm]
TCustomShellTreeView.GetF...
by
Alexx2000
[December 03, 2023, 07:22:01 pm]
Can TreeView Node Colours...
by
Bart
[December 03, 2023, 07:21:27 pm]
Two paintbox, how to set ...
by
krolikbest
[December 03, 2023, 06:38:39 pm]
https page download
by
BubikolRamios
[December 03, 2023, 06:18:50 pm]
Un-register an LCL Compon...
by
JuhaManninen
[December 03, 2023, 06:10:49 pm]
Error: -macosx_version_mi...
by
Koenijn
[December 03, 2023, 06:03:37 pm]
[SOLVED] TPanel slider po...
by
Pe3s
[December 03, 2023, 05:46:45 pm]
Unable to write "/usr/sha...
by
Rbart
[December 03, 2023, 05:27:42 pm]
Can I disable procedure '...
by
Hartmut
[December 03, 2023, 05:02:00 pm]
TAnchorDockPanel - Save a...
by
kapibara
[December 03, 2023, 04:44:58 pm]
Is there an indexable str...
by
jamie
[December 03, 2023, 04:16:54 pm]
Anyone interested in test...
by
cpicanco
[December 03, 2023, 03:59:22 pm]
[Solved] How to shuffle l...
by
Thaddy
[December 03, 2023, 02:24:10 pm]
Virtual Method
by
Mr.Madguy
[December 03, 2023, 01:13:41 pm]
Difference between TSpeed...
by
Zoran
[December 03, 2023, 12:44:57 pm]
BGRA Controls Package Ico...
by
paweld
[December 03, 2023, 11:48:50 am]
unable to rebuild Lazarus
by
Paolo
[December 03, 2023, 11:36:47 am]
[SOLVED] Lazarus png file
by
Pe3s
[December 03, 2023, 11:22:32 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 697 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: 11459
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