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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Как правильно создать на ...
by
n7800
[
Today
at 10:56:04 pm]
[ANN] Fibo Code Format (F...
by
Fibonacci
[
Today
at 10:48:26 pm]
Benchmark regular vs SIMD...
by
MathMan
[
Today
at 10:27:48 pm]
Death of the Power User
by
VisualLab
[
Today
at 08:22:27 pm]
Discipline your AI coding...
by
440bx
[
Today
at 07:36:11 pm]
FPC Unleashed (inline var...
by
440bx
[
Today
at 07:26:45 pm]
Anubis's website security...
by
rvk
[
Today
at 07:21:50 pm]
Trayslate 1.2.0 - Free tr...
by
AlexanderT
[
Today
at 07:21:43 pm]
How to wait until a WebDA...
by
Lutz Mändle
[
Today
at 06:41:49 pm]
LazNodeEditor (visual nod...
by
avra
[
Today
at 06:02:00 pm]
[SOLVED] Curious why this...
by
1HuntnMan
[
Today
at 04:57:24 pm]
Klondike solitaire Part 2
by
TBMan
[
Today
at 04:16:40 pm]
Cannot get FTP to work
by
rvk
[
Today
at 03:32:36 pm]
Problem with upgrading to...
by
wp
[
Today
at 03:15:03 pm]
Anubis activated
by
rvk
[
Today
at 12:45:50 pm]
Can Lazarus support Auto-...
by
Martin_fr
[
Today
at 12:33:34 pm]
TFONT and related init ?
by
jamie
[
Today
at 12:17:36 pm]
ERROR: The current FPC ha...
by
Thaddy
[
Today
at 11:53:06 am]
Run code during DLL load
by
LemonParty
[
Today
at 11:48:20 am]
GocciaScript: JavaScript ...
by
Tomxe
[
Today
at 11:39:14 am]
text color visible
by
hedgehog
[
Today
at 10:36:48 am]
SYnEdit lose cursor
by
Martin_fr
[
Today
at 09:50:48 am]
Portable verion of FPC an...
by
marcov
[
Today
at 09:46:14 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[
Today
at 09:41:18 am]
paszlib. Feature request ...
by
LemonParty
[
Today
at 08:09:37 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Read points from TLineSeries (Read 2256 times)
LemonParty
Sr. Member
Posts: 487
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
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
wp
Hero Member
Posts: 13520
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
Sr. Member
Posts: 487
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
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
wp
Hero Member
Posts: 13520
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
Sr. Member
Posts: 487
Re: Read points from TLineSeries
«
Reply #4 on:
July 26, 2024, 02:38:30 pm »
Thank you. It works.
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
Read points from TLineSeries
TinyPortal
© 2005-2018