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

Message ListMessage List     Post MessagePost Message

  Day separtor for intraday charts
Posted by Tarek on Jul-23-2011 00:12
Is there an automated way to add a line when transitioning between two days in an
intraday chart.


Regards,

  Re: Day separtor for intraday charts
Posted by Peter Kwan on Jul-23-2011 02:57
Hi Tarek,

Basically, you can use Axis.addMark to add vertical a mark line at anywhere along the x-axis.

The following assumes you are using the FinanceChart, and you would like to add the lines in the main price chart (returned when you call addMainChart).

for (int i = extraPoints + 1; i < timeStamps.Length; ++i)
    if (timeStamps[i].Day != timeStamps[i - 1].Day)
        myMainPriceChart.xAxis().addMark(i - extraPoints, 0xff0000);

(Note: the "extraPoints" above is the extraPoints parameter you pass to FinanceChart.setData. It may equal to 0 or some other values. The myMainPriceChart is the XYChart object returned from FinanceChart.addMainChart.)

If you want separator lines in the main price chart as well as indicator charts, you would need to use the same code for each indicator chart. So you may consider to create a function that contains the above code, and call it for the main price chart and the indicator charts.

Hope this can help.

Regards
Peter Kwan