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
Treeview: full-width back...
by
d7_2_laz
[
Today
at 05:02:58 pm]
New release of StrumPract
by
Fred vS
[
Today
at 04:52:40 pm]
Converting a Project from...
by
1HuntnMan
[
Today
at 04:30:20 pm]
SFTP Connection
by
rvk
[
Today
at 04:29:45 pm]
Print GroupBox contents
by
GalZoli
[
Today
at 04:28:49 pm]
TaChart how to draw buffe...
by
wp
[
Today
at 04:07:12 pm]
Circular unit reference b...
by
Martin_fr
[
Today
at 03:56:45 pm]
how to use SetSysColors?
by
robert rozee
[
Today
at 03:46:24 pm]
Add Artificial Intelligen...
by
Joanna from IRC
[
Today
at 03:15:41 pm]
UADE Library
by
Guva
[
Today
at 02:54:05 pm]
[SOLVED] JvCLlaz - Duplic...
by
1HuntnMan
[
Today
at 02:53:20 pm]
fv on macOS M3
by
bnl
[
Today
at 01:55:01 pm]
Length of String is not f...
by
MarkMLl
[
Today
at 01:51:47 pm]
Distance measurments
by
Thaddy
[
Today
at 01:49:19 pm]
AutoFormat IDE plugin
by
fifr
[
Today
at 01:24:50 pm]
[Solved] RxDBGrid bug
by
lainz
[
Today
at 01:20:15 pm]
Generic function is 'wrea...
by
cdbc
[
Today
at 12:22:15 pm]
fpspreadsheet (Spready) -...
by
tatamata
[
Today
at 12:17:03 pm]
Is there a way to emphasi...
by
cdbc
[
Today
at 11:59:34 am]
SnapTRAINER
by
fozkan
[
Today
at 11:52:01 am]
Reading and writing AVIF ...
by
fozkan
[
Today
at 11:48:38 am]
my blog articles about la...
by
fozkan
[
Today
at 11:46:36 am]
my programs crash
by
440bx
[
Today
at 10:42:57 am]
PortAudio Configure Devic...
by
TRon
[
Today
at 10:40:26 am]
app tethering in Lazarus
by
Packs
[
Today
at 09:45:17 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 1658 times)
LemonParty
Full Member
Posts: 111
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: 12605
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
Full Member
Posts: 111
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: 12605
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
Full Member
Posts: 111
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