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

Message ListMessage List     Post MessagePost Message

  Financechart with bar numbers on xAxis
Posted by jcl365 on Jan-28-2011 23:43
How can I format the x axis of a finance chart in a different way so that it shows bar numbers - with an offset - instead of date/time labels? So far, my attempts with chart->xAxis()->setLabelFormat(...) did not achieve the intended results.

  Re: Financechart with bar numbers on xAxis
Posted by Peter Kwan on Jan-29-2011 11:54
Hi jcl365,

If you are using FinanceChart, the FinanceChart object will configure the x-axis label format of all the main price chart and all the indicator charts. If you would like to modify the format, you would need to use FinanceChart.setDateLabelFormat, and this method must be called before you pass data to the FinanceChart (before setData).

The FinanceChart.setDateLabelFormat assumes the timeStamps and labels are date/time. If you would like to display other labels, you may consider to use Axis.setLabels on the first chart added to the FinanceChart object (which can be the main price chart or an indicator chart).

The Axis.setLabels allows you to use an arbitrary array of text strings as labels, and are not affected by any label format configuration (because only date/time or numbers can be formatted - text strings cannot be formatted). The array length should be the same length as your timeStamps array. If there is no label in a particular position, just put an empty string there.

Hope this can help.

Regards
Peter Kwan