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
Flock of Birds
by
Dzandaa
[
Today
at 05:30:05 pm]
How to print a DrawGrid
by
wp
[
Today
at 04:42:19 pm]
https page download
by
BubikolRamios
[
Today
at 04:11:51 pm]
Anyone interested in test...
by
Thaddy
[
Today
at 02:44:32 pm]
Online Package Manager
by
d7_2_laz
[
Today
at 02:38:55 pm]
i can't inatall Dam dialo...
by
Thaddy
[
Today
at 02:38:15 pm]
Unable to write "/usr/sha...
by
Thaddy
[
Today
at 02:26:11 pm]
virus with lazarus-3.0RC2...
by
Thaddy
[
Today
at 01:18:01 pm]
[SOLVED] TStringGrid.Colu...
by
wp
[
Today
at 11:03:07 am]
Advance Record operators ...
by
Thaddy
[
Today
at 07:51:12 am]
Installing Lazarus on a R...
by
dbannon
[
Today
at 06:45:40 am]
Lazarus Release Candidate...
by
dbannon
[
Today
at 06:20:20 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 06:07:39 am]
Creating a "compressed" s...
by
maurobio
[December 03, 2023, 11:19:01 pm]
Lazarus 3.9.9 Variable Wa...
by
Martin_fr
[December 03, 2023, 09:27:11 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]
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]
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]
[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]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 709 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: 11465
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