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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Ancient Program
by
Bart
[
Today
at 11:08:20 pm]
Benchmarks
by
turrican
[
Today
at 11:01:03 pm]
Common File Dialogs Have ...
by
msintle
[
Today
at 11:01:03 pm]
Arrow keys in FV
by
MarkMLl
[
Today
at 10:52:55 pm]
C operators and shift
by
MarkMLl
[
Today
at 10:39:08 pm]
TLazSerial : serial port ...
by
tetrastes
[
Today
at 10:33:38 pm]
TTrayIcon do not work pro...
by
atell
[
Today
at 10:31:11 pm]
SAVE StringGrid to PDF
by
Fred vS
[
Today
at 10:06:07 pm]
[SOLVED] Displaying Float...
by
1HuntnMan
[
Today
at 09:57:19 pm]
[SOLVED] How to calculate...
by
d2010
[
Today
at 09:47:16 pm]
[SOLVED] Getting processe...
by
d2010
[
Today
at 09:32:56 pm]
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]
[SOLVED] Set OnClick even...
by
cdbc
[
Today
at 06:54:53 pm]
Directory-age?!?
by
MarkMLl
[
Today
at 06:40:04 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]
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]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 1445 times)
LemonParty
Jr. Member
Posts: 87
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
wp
Hero Member
Posts: 12459
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
Jr. Member
Posts: 87
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
wp
Hero Member
Posts: 12459
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
Jr. Member
Posts: 87
Re: Read points from TLineSeries
«
Reply #4 on:
July 26, 2024, 02:38:30 pm »
Thank you. It works.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
Read points from TLineSeries
TinyPortal
© 2005-2018