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
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
How to know when dragging...
by
Aistis
[
Today
at 08:56:21 pm]
Tmemo add char like typin...
by
ackarwow
[
Today
at 08:41:20 pm]
Common File Dialogs Have ...
by
rvk
[
Today
at 08:22:34 pm]
[SOLVED] Set OnClick even...
by
cdbc
[
Today
at 06:54:53 pm]
Ancient Program
by
MarkMLl
[
Today
at 06:52:37 pm]
Directory-age?!?
by
MarkMLl
[
Today
at 06:40:04 pm]
SAVE StringGrid to PDF
by
seghele0
[
Today
at 06:27:02 pm]
C operators and shift
by
Seenkao
[
Today
at 06:17:30 pm]
TStatusBar.Color OK in Ob...
by
phidel
[
Today
at 05:51:41 pm]
NSHapticFeedbackPerformer
by
msintle
[
Today
at 04:52:53 pm]
kernel 6.8 and checking s...
by
MarkMLl
[
Today
at 04:35:50 pm]
fphttpapp and Windows Ser...
by
Gapes
[
Today
at 03:49:58 pm]
Inversive Geometry Curves...
by
Boleeman
[
Today
at 03:49:42 pm]
IFS Fractals: Iterating t...
by
Boleeman
[
Today
at 03:44:11 pm]
TLazSerial : serial port ...
by
CM630
[
Today
at 03:30:51 pm]
Storing line colors
by
user5
[
Today
at 03:24:24 pm]
Running 'Exec'-command do...
by
Wings2018
[
Today
at 02:46:25 pm]
Python4Lazarus Undefined ...
by
AlexTP
[
Today
at 02:26:25 pm]
Hustle - A simple task ma...
by
nomorelogic
[
Today
at 12:28:28 pm]
SQLite3 Date Problem
by
Zvoni
[
Today
at 11:54:12 am]
ZUGFeRD: Which PDF lib to...
by
cdbc
[
Today
at 08:03:31 am]
Map vs dataset
by
cdbc
[
Today
at 07:46:53 am]
TTrayIcon do not work pro...
by
Thaddy
[
Today
at 07:36:19 am]
Undefined symbol: WSRegis...
by
ljz111
[
Today
at 07:19:58 am]
Arrow keys in FV
by
Thaddy
[
Today
at 06:33:08 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1690 times)
Curt Carpenter
Hero Member
Posts: 561
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: 12459
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