ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Horizontal line on hloc Layer.
Posted by Hamid on Aug-09-2018 06:15
Need to draw a horizontal line on XYChart with a hloc layer on top. This line needs to start at a particular point on the chart, for example at the high or low of a bar.

Please help.

  Re: Horizontal line on hloc Layer.
Posted by Peter Kwan on Aug-10-2018 01:30
Hi Hamid,

There are many methods. If you are using a standalone XYChart (as opposed to an XYChart contains within FinanceChart), you can:

(a) Add a LineLayer with two data points for the horizontal line.

(b) Add a Mark line (see Axis.addMark). An example of using mark lines is:

https://www.advsofteng.com/doc/cdcpp.htm#markzone.htm

The mark line can be configured to stay behind layers by using Mark.setDrawOnTop. You can use an xZoneColor (see XYChart.xZoneColor) as the color of the mark. The xZoneColor allows you to specify the color depending on the x-coordinates. You can specify the color to be transparent beyond certain x values, so that the line only appears at the position you want it to appear.


Other methods include using BaseChart.addLine, DrawArea.line, etc..

Regards
Peter Kwan