Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
Read points from TLineSeries
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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Putting a new file on a w...
by
J-G
[
Today
at 11:10:43 pm]
[SOLVED]Problem with Mari...
by
Tomu
[
Today
at 10:49:15 pm]
debugger error
by
Martin_fr
[
Today
at 10:38:42 pm]
TCHATGPT — An Artificial ...
by
schuler
[
Today
at 10:00:48 pm]
Which quantized model wor...
by
schuler
[
Today
at 09:45:50 pm]
Slow app start on M5 MacB...
by
Thaddy
[
Today
at 08:16:52 pm]
Peculiarities in the EXE ...
by
Thaddy
[
Today
at 07:49:45 pm]
FPC Unleashed (async/awai...
by
Thaddy
[
Today
at 06:52:05 pm]
Windows 2026_7 update and...
by
Martin_fr
[
Today
at 06:23:32 pm]
KOL4 Beta available.
by
Thaddy
[
Today
at 06:23:08 pm]
This week in OPM!
by
wp
[
Today
at 01:59:33 pm]
FastCGI vs. CGI
by
Thaddy
[
Today
at 01:32:45 pm]
Testing Antropic
by
Tomxe
[
Today
at 12:46:14 pm]
GTK3 is now the default w...
by
Thaddy
[
Today
at 10:22:34 am]
authentiacte through goog...
by
Thaddy
[
Today
at 09:12:56 am]
[SOLVED] Stopped compilin...
by
CM630
[
Today
at 08:41:58 am]
[CLOSED] Seeking performa...
by
Xenno
[
Today
at 08:11:26 am]
Lazarus Main not building...
by
Thaddy
[
Today
at 06:31:42 am]
Setting the CURSOR for th...
by
jamie
[
Today
at 02:16:55 am]
TPeriodicTable
by
wp
[
Today
at 12:19:25 am]
I have made some progress...
by
onionmixer
[July 17, 2026, 08:08:34 pm]
How to connect to MariaDb...
by
jcmontherock
[July 17, 2026, 06:23:38 pm]
Accessing VRAM memory wit...
by
LemonParty
[July 17, 2026, 04:45:30 pm]
docking IDE
by
Martin_fr
[July 17, 2026, 02:13:28 pm]
Engineering Software from...
by
jamie
[July 17, 2026, 12:51:57 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 2281 times)
LemonParty
Hero Member
Posts: 560
Read points from TLineSeries
«
on:
July 24, 2024, 10:07:40 pm »
I have a line series. I added there few points over method AddXY. How can I read these points back?
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
wp
Hero Member
Posts: 13630
Re: Read points from TLineSeries
«
Reply #1 on:
July 24, 2024, 10:35:28 pm »
What do you mean? Read the values by code? Then call Series.XValue[point_index] and Series.YValue[point_index]. Or read the values by pointing or clicking at them with the mouse? In this case use a TDatapointHintTool, a TDatapointClickTool or a TDataPointCrosshairTool - see
https://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Chart_Tools
,
https://wiki.lazarus.freepascal.org/TAChart_documentation#Tools
, or the sample project "tools" in the "demo" folder of the TAChart installation.
Logged
LemonParty
Hero Member
Posts: 560
Re: Read points from TLineSeries
«
Reply #2 on:
July 25, 2024, 09:20:44 am »
Thank you for responce.
The second question remain.
User click in random place on graph. How can I determine the coordinate of click?
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
wp
Hero Member
Posts: 13630
Re: Read points from TLineSeries
«
Reply #3 on:
July 25, 2024, 11:21:12 am »
Write a handler for the chart's OnMouseDown event in which you convert the mouse coordinates to the chart's "graph coordinates" (Chart.ImageToGraph):
Code: Pascal
[Select]
[+]
[-]
uses
TAChartUtils
;
procedure
TForm1
.
Chart1MouseDown
(
Sender
:
TObject
;
Button
:
TMouseButton
;
Shift
:
TShiftState
;
X
,
Y
:
Integer
)
;
var
P
:
TDoublePoint
;
begin
P
:
=
Chart1
.
ImageToGraph
(
Point
(
X
,
Y
)
)
;
ShowMessage
(
Format
(
'MouseDown at %d/%d --> %.3f/%.3f'
,
[
X
,
Y
,
P
.
X
,
P
.
Y
]
)
)
;
end
;
Logged
LemonParty
Hero Member
Posts: 560
Re: Read points from TLineSeries
«
Reply #4 on:
July 26, 2024, 02:38:30 pm »
Thank you. It works.
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
Read points from TLineSeries
TinyPortal
© 2005-2018