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
Was:Forum Upgrade? by @Re...
by
dbannon
[
Today
at 10:45:21 am]
LazCAD – First Release!
by
maurog
[
Today
at 10:37:12 am]
Browser User Agent & Frie...
by
MarkMLl
[
Today
at 10:29:33 am]
Font draw in customdraw i...
by
mikutu
[
Today
at 10:28:00 am]
[Solved] Unable install l...
by
dsiders
[
Today
at 10:27:32 am]
[Solved] PATCH method in ...
by
JohnnieK
[
Today
at 09:13:00 am]
Forum is so SLOOOW... Aga...
by
Gustavo 'Gus' Carreno
[
Today
at 08:15:51 am]
Is there a "canonical" Gi...
by
dsiders
[
Today
at 08:04:09 am]
IDE odd behaviour
by
alpine
[
Today
at 07:38:13 am]
Terminal Component Availa...
by
JZS
[
Today
at 07:37:28 am]
CPU & Memory Profiler
by
AlexTP
[
Today
at 07:29:58 am]
Problem with pasting text...
by
paweld
[
Today
at 06:22:36 am]
Advice/Guidance Needed Wi...
by
dbannon
[
Today
at 06:07:33 am]
TStateMachine
by
avra
[
Today
at 12:44:55 am]
Lazarus IDE Windows 64 lo...
by
StuPot
[
Today
at 12:01:38 am]
My first Attempt making a...
by
jamie
[September 09, 2024, 11:43:32 pm]
Extended Module Player
by
Gigatron
[September 09, 2024, 09:11:48 pm]
How to disable the compat...
by
Jonas Maebe
[September 09, 2024, 08:59:30 pm]
How to create webhook in ...
by
Prakash
[September 09, 2024, 07:59:41 pm]
New Component jZCamView
by
Guser979
[September 09, 2024, 07:49:22 pm]
Forum upgrade?
by
MarkMLl
[September 09, 2024, 07:47:00 pm]
Is there a maximum length...
by
Remy Lebeau
[September 09, 2024, 07:35:30 pm]
THTTPRouter Documentation
by
JohnnieK
[September 09, 2024, 05:54:48 pm]
TryStrToFloat
by
jcmontherock
[September 09, 2024, 05:25:30 pm]
Having difficulty buidlin...
by
MarkMLl
[September 09, 2024, 03:49:23 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 1069 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: 12274
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: 12274
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