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 copy file to web
by
bobonwhidbey
[
Today
at 11:44:03 pm]
Interesting article about...
by
Joanna from IRC
[
Today
at 11:40:54 pm]
Classic objects — does FP...
by
flowCRANE
[
Today
at 11:35:02 pm]
Starting a program with h...
by
jeremiah
[
Today
at 10:57:53 pm]
Q: Debug a plugin DLL - c...
by
d7_2_laz
[
Today
at 10:52:49 pm]
How make the GUI as one p...
by
Fibonacci
[
Today
at 10:49:16 pm]
SDL2 Fit image rotation b...
by
bobihot
[
Today
at 10:31:27 pm]
[Solved] Dumb SQLite ques...
by
heebiejeebies
[
Today
at 10:04:26 pm]
[Solved] Crosshair error ...
by
Marq01
[
Today
at 09:55:14 pm]
What is the history of di...
by
mika
[
Today
at 09:49:59 pm]
Unwanted additional line ...
by
Ten_Mile_Hike
[
Today
at 09:34:47 pm]
fpweb documentation do no...
by
Sniper
[
Today
at 09:02:16 pm]
Managed pointers
by
jksmithiii
[
Today
at 08:42:29 pm]
[Solved] Debug a plugin D...
by
d7_2_laz
[
Today
at 05:27:48 pm]
SAVE StringGrid to PDF
by
seghele0
[
Today
at 05:19:19 pm]
Who catches the Linux sig...
by
MarkMLl
[
Today
at 04:43:45 pm]
TvsComPort on MacOS Sierr...
by
Dzandaa
[
Today
at 04:23:21 pm]
Adding interfaces to any ...
by
Warfley
[
Today
at 03:48:44 pm]
Animated GIF's and Lazaru...
by
lainz
[
Today
at 03:11:11 pm]
[SOLVED] TRichMemo and te...
by
MarkMLl
[
Today
at 01:56:57 pm]
How to display empty stri...
by
krzynio
[
Today
at 01:55:38 pm]
crash db navigator with L...
by
calm_sea
[
Today
at 01:45:38 pm]
Common File Dialogs Have ...
by
zeljko
[
Today
at 01:05:36 pm]
Dymo label writers
by
MarkMLl
[
Today
at 11:25:25 am]
Application deployment
by
Warfley
[
Today
at 10:30:39 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1707 times)
Curt Carpenter
Hero Member
Posts: 567
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: 12476
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