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
Browser User Agent & Frie...
by
Aruna
[
Today
at 08:01:00 pm]
programming with Lazarus
by
Josh
[
Today
at 07:41:01 pm]
LazCAD – First Release!
by
maurog
[
Today
at 07:13:54 pm]
LED Multicolor Keyboard C...
by
Aruna
[
Today
at 07:11:25 pm]
Unexpected Project1 Form ...
by
Atlanta0001
[
Today
at 07:05:07 pm]
How to "Jump To" the "beg...
by
WooBean
[
Today
at 06:12:51 pm]
How to use newer macOS SD...
by
apeoperaio
[
Today
at 06:02:07 pm]
Effect of streaming in a ...
by
vfclists
[
Today
at 06:01:15 pm]
Getting error: Undefined ...
by
DiegoF
[
Today
at 05:22:21 pm]
Listview how to custom or...
by
VisualLab
[
Today
at 05:06:37 pm]
TryStrToFloat
by
TRon
[
Today
at 04:30:47 pm]
Using synapse to send ema...
by
hamacker
[
Today
at 03:50:53 pm]
Unable to Query the ODBC ...
by
Thaddy
[
Today
at 03:43:31 pm]
Searching for a safe alte...
by
marcov
[
Today
at 03:12:42 pm]
MariaDB sold to Investor
by
dbannon
[
Today
at 02:55:32 pm]
Lazarus always uses a 32 ...
by
Martin_fr
[
Today
at 02:37:27 pm]
Class designer/editor
by
Aruna
[
Today
at 02:28:35 pm]
[Solved] Unable install l...
by
JohnnieK
[
Today
at 09:12:35 am]
SnapTRAINER
by
davenardella
[
Today
at 08:28:42 am]
Broken Icon Display on ma...
by
dsiders
[
Today
at 07:31:54 am]
Local Vars often inspect ...
by
SandyG
[
Today
at 05:21:45 am]
TListView.OnChange Event ...
by
msintle
[
Today
at 02:18:23 am]
Extended Module Player
by
bobby100
[
Today
at 12:21:08 am]
TDBF Recordcount
by
gidesa
[September 12, 2024, 08:32:55 pm]
CLI | Wildcard parameters...
by
MarkMLl
[September 12, 2024, 07:47:14 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 1137 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