Recent

Author Topic: How to draw a line as threshhold on chart?  (Read 578 times)

senglit

  • Jr. Member
  • **
  • Posts: 74
How to draw a line as threshhold on chart?
« 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!
I use Win10 + Lazarus 2.0.10 + FPC 3.2.0. All 64bit.

h-elsner

  • Newbie
  • Posts: 2
Re: How to draw a line as threshhold on chart?
« Reply #1 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

wp

  • Hero Member
  • *****
  • Posts: 8400
Re: How to draw a line as threshhold on chart?
« Reply #2 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".
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

senglit

  • Jr. Member
  • **
  • Posts: 74
Re: How to draw a line as threshhold on chart?
« Reply #3 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
I use Win10 + Lazarus 2.0.10 + FPC 3.2.0. All 64bit.

 

TinyPortal © 2005-2018