|
Finance Chart Label |
Posted by Sunil Abraham on Jan-11-2012 01:53 |
|
By default the label of finance chart is dispalying the last date values (high, open, low etc). Is it possible to display the label values of my prefered date value. |
Re: Finance Chart Label |
Posted by Peter Kwan on Jan-12-2012 00:32 |
|
Hi Sunil,
There are two methods I can think of:
(a) If you know the exact text you want to display in the legend box, you may disable the legend box entirely (see http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1285626288#N1285671868 for an example), and then use BaseChart.addText to add a custom text box with your text in the original legend position.
(b) You may modify the FinanceChart source code to make it display other values. The exact details depend on your programming language. See the documentation on FinanceChart (you may look for FinanceChart in the ChartDirector documentation index) on to location of the FinanceChart source code, and how you can use it in your own code. For your case, the places to modify in the FinanceChart source code is in the addOHLCLabel method (which is for generating the open/high/low/close legend entry), and the formatIndicatorLabel method (which is for generating the legend entry for all other indicators).
Hope this can help.
Regards
Peter Kwan |
Re: Finance Chart Label |
Posted by Sunil Abraham on Jan-12-2012 01:59 |
|
I prefer the first method. But how to know the values of all the indicators when i move the mouse over chart. For eg: if there are Candle Stick, Bollinger Band and SMA on the main chart and Momentum Indicator as a Append chart. I need to know the values of all 4 indicators of a particular date where the mouse is on. and i need to display it with addText method. |
Re: Finance Chart Label |
Posted by Peter Kwan on Jan-13-2012 00:54 |
|
Hi Sunil,
After plotting the chart, ChartDirector may discard the data. It is because after plotting the data, the data are no longer needed by ChartDirector, so the data may be discarded to save memory. By the time you can move the mouse on the chart, ChartDirector may no longer know what are the values of SMA, Bollinger Band, etc.. If you need them values, you may modify the FinanceChart source code to store its internal computations so you can retrieve them later. See:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1264519533#N1264527203
Hope this can help.
Regards
Peter Kwan |
|