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

Message ListMessage List     Post MessagePost Message

  Line on AreaChart
Posted by John Best on Feb-28-2019 20:54
Attachments:
Hi Peter,

Please have a look at the image.

The black line is Close Price of a stock. (Probably a line chart)
The other two are area charts. The small one is of Volume and the other is Open Intt.

Can this be done with Chart Director? If yes, how? A little code will help me a lot.

Regards
JB
sample.png

  Re: Line on AreaChart
Posted by Peter Kwan on Mar-01-2019 12:35
Hi John,

If you want to use an XYChart, you can just call addLineLayer to add the line layer, and call addAreaLayer twice to add the two area layers. See:

https://www.advsofteng.com/doc/cdcom.htm#arealine.htm

If you are using the FinanceChart object, in the main chart, there is already a built-in method FinanceChart.addCloseLine to add the line for the close price.

https://www.advsofteng.com/doc/cdcom.htm#FinanceChart.addCloseLine.htm

The object returned from FinanceChart.addMainChart is itself an XYChart, so you can call addAreaLayer to add two more area layers.

If the data you use are not comparable between each others (such as if they are using different units), you may consider to use different y-axis for different layers. Here are some examples:

https://www.advsofteng.com/doc/cdcom.htm#dualxaxis.htm

https://www.advsofteng.com/doc/cdcom.htm#multiaxes.htm

Regards
Peter Kwan

  Re: Line on AreaChart
Posted by John Best on Mar-01-2019 15:00
Hi Peter,

Thanks a lot. Will give it a try. In case of problem will come back to you...

Thanks a lot again. :)

Regards
JB