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
Small Status Bar Demo
by
MonsterMaze
[
Today
at 09:04:06 pm]
Unique Instance Terminate...
by
KodeZwerg
[
Today
at 09:03:58 pm]
[SOLVED] TLabeledEdit.Edi...
by
dsiders
[
Today
at 08:49:22 pm]
Autentication Oracle
by
CapitaoVirgulinoFerreira
[
Today
at 07:49:31 pm]
Lazarus Release Candidate...
by
dedrasta
[
Today
at 07:21:58 pm]
Export Stringgrid to an x...
by
majid.ebru
[
Today
at 07:14:01 pm]
[Solved] i can't inatall ...
by
majid.ebru
[
Today
at 06:55:28 pm]
ControlsCodePage presents...
by
Gercino
[
Today
at 06:20:40 pm]
TStringGrid with stretche...
by
wp
[
Today
at 05:54:54 pm]
Mac OS 3.0RC2 throws __da...
by
sawtelle
[
Today
at 05:10:57 pm]
Battery Operations
by
Hansaplast
[
Today
at 04:26:54 pm]
CORDIC algorithms
by
Curt Carpenter
[
Today
at 04:23:32 pm]
[SOLVED] How to stay in t...
by
Hartmut
[
Today
at 04:14:16 pm]
Lazarus 3.9.9 Variable Wa...
by
Martin_fr
[
Today
at 03:55:01 pm]
How to convert Real to Bi...
by
kwyan
[
Today
at 03:41:14 pm]
Linux snapshot zip files ...
by
TRon
[
Today
at 03:30:03 pm]
Anyone interested in test...
by
Josh
[
Today
at 02:09:03 pm]
New version of BGRABitmap
by
lainz
[
Today
at 01:15:01 pm]
Automatize build system
by
Чебурашка
[
Today
at 12:20:44 pm]
lazarus controlling compi...
by
Bart
[
Today
at 11:33:03 am]
SVG thumbnails
by
domasz
[
Today
at 11:18:31 am]
How to "create" a TFont a...
by
kwyan
[
Today
at 04:29:00 am]
SOLVED How to get PRAGMA ...
by
JanRoza
[
Today
at 01:36:33 am]
Component writing adding ...
by
andrew Bubble
[
Today
at 12:01:02 am]
Compare strange character...
by
nikel
[December 05, 2023, 11:33:21 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 755 times)
Curt Carpenter
Sr. Member
Posts: 342
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: 11480
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