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
Unable to write "/usr/sha...
by
Martin_fr
[
Today
at 03:37:55 pm]
Can I disable procedure '...
by
Martin_fr
[
Today
at 03:23:26 pm]
TPanel slider position
by
Handoko
[
Today
at 02:41:25 pm]
[Solved] How to shuffle l...
by
Thaddy
[
Today
at 02:24:10 pm]
Creating a "compressed" s...
by
maurobio
[
Today
at 02:15:53 pm]
TCustomShellTreeView.GetF...
by
Alexx2000
[
Today
at 01:28:12 pm]
Advance Record operators ...
by
Thaddy
[
Today
at 01:14:35 pm]
Virtual Method
by
Mr.Madguy
[
Today
at 01:13:41 pm]
Difference between TSpeed...
by
Zoran
[
Today
at 12:44:57 pm]
BGRA Controls Package Ico...
by
paweld
[
Today
at 11:48:50 am]
unable to rebuild Lazarus
by
Paolo
[
Today
at 11:36:47 am]
TAnchorDockPanel - Save a...
by
zamtmn
[
Today
at 11:25:56 am]
[SOLVED] Lazarus png file
by
Pe3s
[
Today
at 11:22:32 am]
[SOLVED] How to force Eve...
by
Hartmut
[
Today
at 10:54:57 am]
[SOLVED] TStringGrid colo...
by
Hansvb
[
Today
at 10:33:43 am]
How to detect uninitialis...
by
kwyan
[
Today
at 10:28:19 am]
Is there an indexable str...
by
cdbc
[
Today
at 10:24:58 am]
Online Package Manager
by
lainz
[
Today
at 09:54:36 am]
Lazarus Release Candidate...
by
dedrasta
[
Today
at 09:52:02 am]
Error: -macosx_version_mi...
by
dbannon
[
Today
at 09:06:18 am]
BGRABitmap - showcase -
by
Mongkey
[
Today
at 08:27:14 am]
Date-Stamp DBDateEdit
by
cdbc
[
Today
at 08:00:06 am]
i can't inatall Dam dialo...
by
paweld
[
Today
at 07:12:41 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 03:28:20 am]
[SOLVED]Bash commands and...
by
TRon
[
Today
at 02:52:35 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 686 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: 11454
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