|
How add trailing spaces at the end of the candlestick |
Posted by Cj Talas on Nov-08-2011 18:11 |
|
Hi Peter Kwan,
Im not sure if you have a better way of doing this.
I want to add spaces after the candlesticks, the way im doing this is add nulls as data at the end.
As for the SMA's, before creating i try to override the data by removing those nulls.
Do you have any other approach like a margin/padding option for the candles?
I am attaching a sample of what i am doing.
What i dont like about my approach is it takes a lot of data manipulation.
Hopefully you can point me to the right direction.
Again thank you in advance.
Regards,
CJ
|
Re: How add trailing spaces at the end of the candlestick |
Posted by Cj Talas on Nov-08-2011 18:16 |
|
I would also like to note that this is a continuation to the question posted on this thread:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=cj+talas&thread=1320407927#N1320426887
Cj Talas wrote:
Hi Peter Kwan,
Im not sure if you have a better way of doing this.
I want to add spaces after the candlesticks, the way im doing this is add nulls as data at the end.
As for the SMA's, before creating i try to override the data by removing those nulls.
Do you have any other approach like a margin/padding option for the candles?
I am attaching a sample of what i am doing.
What i dont like about my approach is it takes a lot of data manipulation.
Hopefully you can point me to the right direction.
Again thank you in advance.
Regards,
CJ
|
Re: How add trailing spaces at the end of the candlestick |
Posted by Peter Kwan on Nov-09-2011 00:43 |
|
Hi Cj,
There are two methods:
(a) Insert additional values to the timeStamps array. (There is no need to modify other arrays.) I suggest to simply repeat the last value. It should not need a lot of code. For example, in PHP, it is like:
for ($i = 0; $i < 5; ++$i) $timeStamps[] = $timeStamps[count($timeStamps) - 1];
or
$timeStamps = array_pad($timeStamps, count($timeStamps) + 5, $timeStamps[count($timeStamps) - 1]);
(b) Use Axis.setMargin to add a left margin to the x-axis. For example:
#$m = XYChart object representing the main price chart
$m->xAxis->setMargin(0, 20);
Hope this can help.
Regards
Peter Kwan |
Re: How add trailing spaces at the end of the candlestick |
Posted by Cj Talas on Nov-10-2011 08:18 |
|
Hi Peter,
I went with the second approach... thanks a lot. As a result this is now how my chart looks like
Thanks for you help.
|
|