[Lazarus] TAChart CandleStick Chart

Werner Pamler werner.pamler at freenet.de
Mon Oct 6 20:45:30 CEST 2014


 >> How can I make color of the tails like body?
I uploaded a small modification today which takes care of your request: 
the color of the body border and the tails of the CandleStick series is 
determined by the property CandleStickLinePen. If you set this color to 
clDefault these lines will be painted in the color of the body. Please 
see the updated "financial" demo.

 >> How can I add HorzScrollBar or something like this and keep the 
scale of CandleStick?
In TAChart you can zoom by left-dragging a rectangle across the chart. 
And you can pan the zoomed window by dragging with the right-mouse 
button down. Or you can implement more sophisticated features by using 
the chart tools.

In addition, there is a TChartNavScrollbar which you can use to scroll 
the zoomed window across the chart range. You just have to link its 
"Chart" property to the chart which you want to control. The "Min" and 
"Max" of the scrollbar map to the data range used in the chart. To get 
day-by-day scrolling set the scrollbar's Min and Max to the 
corresponding values of the horizontal axis (Chart1.GetFullExtent.a.x 
and b.x) at run-time.

Moreover, there is also a TChartNavPanel which displays the full range 
of the data and encloses the zoomed range by a rectangle. You can drag 
this rectangle over the chart, and the zoom window will follow 
automatically. Having "MiniMap" true displays a miniature chart for 
rough orientation. Again, you have to couple it to the chart of interest 
by means of the "Chart" property. In my feeling, however, there are 
still some weaknesses of this component, maybe I can look after them in 
the next days.

BTW: Do you know the TAChart documentation 
http://wiki.lazarus.freepascal.org/TAChart_documentation?





More information about the Lazarus mailing list