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

Message ListMessage List     Post MessagePost Message

  Change the date time format from Gregorian to Jalali
Posted by afshin on Nov-06-2011 19:49
Hello all

Thank you for your wonderful and useful library.
I have a problem with financial charts and date-time labels. I want to add my custom date-time formating (Jalali date-time) but I don't know how can I do that.
Please help me.

Best regards
Afshin

  Re: Change the date time format from Gregorian to Jalali
Posted by Peter Kwan on Nov-08-2011 01:53
Hi Afshin,

I assume you are using the FinanceChart object.

To use custom x-axis labels, you would need to set the labels to the first chart that you add to the FinanceChart. (The FinanceChart may contain a main price chart as well as zero or more indicator charts.) For example, suppose the first chart you add to the FinanceChart is the main price chart. In Java, it is like:

//assuming this is the first chart you add to the FinanceChart
XYChart myMainChart = myFinanceChart.addMainChart(...........);

myMainChart.xAxis().setLabels(anArrayOfLabels);

In the above, anArrayOfLabels is a string array. The array size should be of the same as the timeStamps array. Each element of the array is the label for the trading session of the corresponding timeStamp. If no label is needed for a certain trading session, you may use an empty string as the label.

Hope this can help.

Regards
Peter