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
Lazarus for Windows on aa...
by
msintle
[
Today
at 01:53:20 am]
Common File Dialogs Have ...
by
msintle
[
Today
at 01:52:27 am]
How to set the desktop co...
by
zxandris
[
Today
at 01:40:00 am]
Game Music Emulator
by
TRon
[
Today
at 01:23:56 am]
Printing unicode one char...
by
bobonwhidbey
[
Today
at 01:19:18 am]
FPSpreadSheet, ReadAsText...
by
wp
[
Today
at 01:00:57 am]
had a question and found ...
by
Weiss
[
Today
at 12:59:57 am]
Constants in constant exp...
by
440bx
[December 08, 2024, 11:41:59 pm]
ColorDialog can have opti...
by
Bart
[December 08, 2024, 09:14:55 pm]
Array of String lookup gi...
by
TRon
[December 08, 2024, 09:04:03 pm]
kernel 6.8 and checking s...
by
MarkMLl
[December 08, 2024, 08:12:08 pm]
AVRPascal – free code edi...
by
ackarwow
[December 08, 2024, 07:34:07 pm]
Api/component pack for Ra...
by
MarkMLl
[December 08, 2024, 07:11:01 pm]
SAVE StringGrid to PDF
by
dseligo
[December 08, 2024, 06:37:39 pm]
How to save a Graphic fro...
by
Hartmut
[December 08, 2024, 05:57:03 pm]
Array of String lookup gi...
by
Wilko500
[December 08, 2024, 05:47:16 pm]
Developing a Kernel Modul...
by
Joanna from IRC
[December 08, 2024, 04:35:26 pm]
Interesting article about...
by
cdbc
[December 08, 2024, 03:18:36 pm]
How to get hash of entire...
by
Warfley
[December 08, 2024, 01:30:18 pm]
IFS Fractals: Iterating t...
by
Dzandaa
[December 08, 2024, 11:51:08 am]
Баги CYBERGRAPHICS AmigaO...
by
Smalovsky
[December 08, 2024, 09:39:52 am]
C operators and shift
by
MarkMLl
[December 08, 2024, 09:33:12 am]
fphttpapp and Windows Ser...
by
Thaddy
[December 08, 2024, 08:36:36 am]
MIDI file generator - wor...
by
finlazarus
[December 08, 2024, 02:49:40 am]
How do I use/call functio...
by
RedOctober
[December 08, 2024, 02:43:07 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1702 times)
Curt Carpenter
Hero Member
Posts: 564
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: 12461
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