Recent

Author Topic: need to understand extents  (Read 3610 times)

ronhud

  • Jr. Member
  • **
  • Posts: 96
need to understand extents
« on: December 20, 2024, 05:29:30 pm »
I would like to create a candlestick chart which grows across the chart width as new day data is added.   I have a candlestick chart working but it spaces the data to fill the full width of the chart.    Do I need to set the logical extent width to some value to start with - say when I hve one day's data and increase that width each time I add another day?    The candlestick chart demo I downloaded has a 'tick width' which I understand to be the width of the candle but I cannot see a way to control the space between candles.
I have read the tutorial on TAChart but failed to understand it enough to answer my question.

wp

  • Hero Member
  • *****
  • Posts: 12593
Re: need to understand extents
« Reply #1 on: December 20, 2024, 10:50:48 pm »
I don't fully understand the problem. Maybe you need to set the series' TickWidthStyle to twsPercentMin - this results in constant candle widths even when the data points are not equidistant.

ronhud

  • Jr. Member
  • **
  • Posts: 96
Re: need to understand extents
« Reply #2 on: December 21, 2024, 12:35:54 pm »
The attached image shows the data line ending before it reaches the right side of the chart.    I would like to be able to control that position.
The Properties window shows a TickWidth property for the hloc series but not a  TickWidthStyle.

wp

  • Hero Member
  • *****
  • Posts: 12593
Re: need to understand extents
« Reply #3 on: December 21, 2024, 02:14:06 pm »
Ah, sorry - I am using Laz/main, and TickWidthstyle is not yet available in Laz 3.x and older.

See the attached demo for how to use the extent of an ohlc series. But note that - without TickWidthStyle - the datapoints must be equidistant, otherwise the width of the candle bars will vary.

ronhud

  • Jr. Member
  • **
  • Posts: 96
Re: need to understand extents
« Reply #4 on: December 22, 2024, 12:08:04 pm »
Thank you for the demo which is what I am after.   What is laz/main?

TRon

  • Hero Member
  • *****
  • Posts: 3946
Re: need to understand extents
« Reply #5 on: December 22, 2024, 12:31:42 pm »
What is laz/main?
Happened to be around so  :)

laz/main aka laz/trunk is Lazarus but the bleeding edge version directly from the source-tree of the Lazarus development repository. main refers to the branch inside that repository, see https://gitlab.com/freepascal.org/lazarus/lazarus

PS: a version not recommended to be used by end-users especially in case your projects depend on a reliable development cycle (unless really requiring a new feature that only exist in main and in which case you have to know what you are doing). Developers try to keep it as stable as possible but on occasion the main version does break or introduce non backwards compatible changes. Using main effectively designates the user of it as a beta tester (or actually alpha tester)
« Last Edit: December 22, 2024, 12:57:24 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

ronhud

  • Jr. Member
  • **
  • Posts: 96
Re: need to understand extents
« Reply #6 on: December 22, 2024, 01:28:21 pm »
Thank you for the explanation.   Earlier in this thread I was advised re a property of ohlcSeries , namely TickWidthStyle but it appears to only be in Laz/Main.   Presumably it will be part of a stable version eventually .

wp

  • Hero Member
  • *****
  • Posts: 12593
Re: need to understand extents
« Reply #7 on: December 22, 2024, 03:21:01 pm »
Presumably it will be part of a stable version eventually .
It is available in Lazarus v4.0RC1.

 

TinyPortal © 2005-2018