Lazarus

Programming => Graphics and Multimedia => TAChart => Topic started by: senglit on April 23, 2021, 06:54:50 am

Title: How to draw a line as threshhold on chart?
Post by: senglit on April 23, 2021, 06:54:50 am
Hi all,

I got a chart with LineSeries, on which data can be shown properly. Now I want to add 2 lines as threshold. When the users look at the chart they can see easily data under the lower threshhold line is safe, data between two threshold lines means warnning, data hight then the higher threshhold line is dangerous.

For example, all of the data is between 20 and 120, I want to draw the threshhold lines at 53 and 68. How to do it?

Thanks!
Title: Re: How to draw a line as threshhold on chart?
Post by: h-elsner on April 23, 2021, 09:03:53 am
I use ConstantLines, vertical or horizontal. You can make it visible or not in code, can change position, color and so on. For me this is good and fulfills all needs.

br HE
Title: Re: How to draw a line as threshhold on chart?
Post by: wp on April 23, 2021, 09:12:16 am
Yes, add a TConstantLine. Set its "Linestyle" to lsHorizontal or lsVertical for a horizontal or vertical line. The coordinate is defined by the value of "Position".
Title: Re: How to draw a line as threshhold on chart?
Post by: senglit on April 23, 2021, 01:10:36 pm
Thanks for h-elsner and wp. I got what I want. :D

I use ConstantLines, vertical or horizontal. You can make it visible or not in code, can change position, color and so on. For me this is good and fulfills all needs.

br HE
TinyPortal © 2005-2018