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
TryStrToFloat
by
TRon
[
Today
at 11:25:17 pm]
Searching for a safe alte...
by
jamie
[
Today
at 11:05:25 pm]
Extended Module Player
by
TRon
[
Today
at 10:29:07 pm]
Class designer/editor
by
Aruna
[
Today
at 10:10:45 pm]
Browser User Agent & Frie...
by
Aruna
[
Today
at 09:53:42 pm]
TDBF Recordcount
by
gidesa
[
Today
at 08:32:55 pm]
CLI | Wildcard parameters...
by
MarkMLl
[
Today
at 07:47:14 pm]
TListView.OnChange Event ...
by
Bart
[
Today
at 07:10:00 pm]
LazCAD – First Release!
by
jcarlos77
[
Today
at 05:27:40 pm]
Listview how to custom or...
by
VisualLab
[
Today
at 04:59:00 pm]
Broken Icon Display on ma...
by
msintle
[
Today
at 04:46:35 pm]
programming with Lazarus
by
srvaldez
[
Today
at 04:03:11 pm]
Change execution order wh...
by
Khrys
[
Today
at 03:02:06 pm]
7zip DLL is super broken
by
rvk
[
Today
at 01:55:47 pm]
Hints.
by
seghele0
[
Today
at 12:29:35 pm]
Error code 5
by
ccrause
[
Today
at 11:14:19 am]
Font draw in customdraw i...
by
mikutu
[
Today
at 08:02:02 am]
Problems with Gitlab
by
Joanna
[
Today
at 07:35:08 am]
Cannot open Access databa...
by
Khrys
[
Today
at 06:59:12 am]
TMemo and paste from clip...
by
Aruna
[
Today
at 05:58:24 am]
environment variables
by
dbannon
[
Today
at 01:59:07 am]
[SOLVED] TDBDateEdit comp...
by
wp
[September 11, 2024, 11:56:30 pm]
TStateMachine
by
matthius
[September 11, 2024, 11:40:00 pm]
Any support for Perpendic...
by
circular
[September 11, 2024, 09:05:59 pm]
Local Vars often inspect ...
by
Martin_fr
[September 11, 2024, 08:58:22 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 1123 times)
LemonParty
Jr. Member
Posts: 82
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: 12287
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: 82
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: 12287
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: 82
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