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
C operators and shift
by
dseligo
[
Today
at 11:06:58 am]
Common File Dialogs Have ...
by
rvk
[
Today
at 10:24:42 am]
How to know when dragging...
by
Aistis
[
Today
at 09:40:34 am]
SQLite3 Date Problem
by
Thaddy
[
Today
at 09:05:58 am]
Inversive Geometry Curves...
by
Thaddy
[
Today
at 08:56:11 am]
kernel 6.8 and checking s...
by
MarkMLl
[
Today
at 08:51:22 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]
[SOLVED] How much would i...
by
egsuh
[
Today
at 06:15:02 am]
storing string
by
Wesbat
[
Today
at 04:51:11 am]
Breakpoint dosn't work
by
Martin_fr
[
Today
at 12:43:37 am]
[SOLVED] Howto use a DEFI...
by
bytebites
[
Today
at 12:05:01 am]
Tmemo add char like typin...
by
ackarwow
[December 05, 2024, 10:47:59 pm]
Python4Lazarus Undefined ...
by
AlexTP
[December 05, 2024, 08:42:33 pm]
mxMarkEdit, a new visual ...
by
maxnd
[December 05, 2024, 06:08:17 pm]
Api/component pack for Ra...
by
MarkMLl
[December 05, 2024, 04:47:33 pm]
compiler messages suggest...
by
Thaddy
[December 05, 2024, 04:15:17 pm]
Wrong resolution of secon...
by
Apiglio
[December 05, 2024, 03:13:47 pm]
Benchmarks
by
Warfley
[December 05, 2024, 02:00:39 pm]
[Solved]I have created dl...
by
Packs
[December 05, 2024, 01:11:27 pm]
TLazSerial : serial port ...
by
tetrastes
[December 05, 2024, 12:26:29 pm]
Bright color
by
Warfley
[December 05, 2024, 10:29:06 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tracking TChart cursor (Read 1685 times)
Curt Carpenter
Hero Member
Posts: 560
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