Hi all!
I am using Teecharts PHP version ( 04-March-2009).
How can I:
1. leave weekend days from a chart displaying candles? ( now, there is a gap at weekends )
2. set border width to 0 ? ( something draw a thick line to the bottom and right side of my chart )
3. set volume chart type's width ? ( change to bar type is the only solution? )
4. set axis's title offset? or remove axis labels, but keep the scaling help lines?
Thanks a lot
T
some question
Hi,
Please download the latest version from our web site which includes some modifications related to this.
In the case you want to hide the axis labels you can always set a transparent color for font :
One way would be to use similar code to the following one :1. leave weekend days from a chart displaying candles? ( now, there is a gap at weekends )
Code: Select all
// Axis labels no Weekends
// Depending if the table contains data from weekends or not you can make use of the dayofweek comparison (setting the label into the addCandle method) or setting the labels using the setLabels method.
$chart->getAspect()->setView3D(false);
$candle = new Candle($chart->getChart());
// Create array of DateTime Values, which could be obtained from BBDD.
$labels = Array("08/05/2008",
"09/05/2008",
"12/05/2008",
"13/05/2008",
"14/05/2008",
"15/05/2008",
"16/05/2008",
"19/05/2008",
"20/05/2008",
"21/05/2008",
"22/05/2008",
"23/05/2008");
/* no dates */
$candle->getXValues()->setDateTime(false);
$chart->getAxes()->getBottom()->getLabels()->setAngle(90);
/* fill the candle with random points */
$generator = rand(0,1000);
$tmpOpen = $generator*1000;
$count = 0;
for ($t=0; $t < 13; $t++) {
$tmpOpen = $tmpOpen + $generator*100 - 50;
$tmpClose = $tmpOpen - $generator*100 + 50;
$dayOfWeek = jddayofweek ( cal_to_jd(CAL_GREGORIAN, date("m"),date("d")+$t, date("Y")) , 1 );
if (($dayOfWeek != 'Saturday') && ($dayOfWeek != 'Sunday'))
{
++$count;
/* add the point */
$candle->addCandle(
$count,
$tmpOpen,
$tmpOpen + $generator*10,
$tmpClose - $generator*10,
$tmpClose,
$dayOfWeek
);
}
}
// $candle->setLabels($labels);
$chart->getAxes()->getBottom()->getLabels()->setStyle(AxisLabelStyle::$TEXT);
$chart->getLegend()->setVisible(false);
$chart->getPanel()->getBevel()->setWidth(0);
Yes, it's the 3D effect border, it can be changed by using :2. set border width to 0 ? ( something draw a thick line to the bottom and right side of my chart )
Code: Select all
$chart->getPanel()->getBevel()->setWidth(0);
You can change the width of the Volume bar by using :3. set volume chart type's width ? ( change to bar type is the only solution? )
Code: Select all
$volume->getLinePen()->setWidth(3);
I suggest you download the latest TeeChart for PHP version (ujpdated on 14th March) from our web site. This version includes some fixes and changes related on this matter ( axis title ).4. set axis's title offset? or remove axis labels, but keep the scaling help lines?
In the case you want to hide the axis labels you can always set a transparent color for font :
Code: Select all
$chart->getChart()->getAxes()->getBottom()->getLabels()->getFont()->setColor(new Color(0,0,0,255));
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi!
Thank you very much, almost all of my problems were solved.
One more:
I've tried to find out the way how can i format the label values on the axis...
Perhaps you can give me some example
In this particular case i have to shorten the values on the vertical axis ( the volume series on the horizontal axis). for eexample: 10000000 -> 10M or 5000 -> 5k
Thank you again!!!
Thank you very much, almost all of my problems were solved.
One more:
I've tried to find out the way how can i format the label values on the axis...
Perhaps you can give me some example
In this particular case i have to shorten the values on the vertical axis ( the volume series on the horizontal axis). for eexample: 10000000 -> 10M or 5000 -> 5k
Thank you again!!!
Hi,
at this moment one way would be to add custom axis labels manually, for example using similar code to the following one (it clears all the left axis labels and then add a specific label at specific value position) :
I'm just implementing new events for the TeeChart for PHP version, and one of them is the OnGetAxisLabel event which allows to change the axis labels easily just by checking which label is going to be displayed and modifing it if necessary. I'll advise when the version which includes this event is prepared.
at this moment one way would be to add custom axis labels manually, for example using similar code to the following one (it clears all the left axis labels and then add a specific label at specific value position) :
Code: Select all
$chart->getChart()->getAxes()->getLeft()->getLabels()->setStyle(AxisLabelStyle::$TEXT);
// To draw custom labels on the axis : $chart->getChart()->getAxes()->getLeft()->getLabels()->getItems()->clear(); $chart->getChart()->getAxes()->getLeft()->getLabels()->getItems()->add(5000,"5k");
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: some question
I'm just implementing new events for the TeeChart for PHP version, and one of them is the OnGetAxisLabel event which allows to change the axis labels easily just by checking which label is going to be displayed and modifing it if necessary. I'll advise when the version which includes this event is prepared.
Did this improved version get posted? This was 3 months ago. Any news?
Did this improved version get posted? This was 3 months ago. Any news?
Re: some question
Hello,
not for the moment, sorry for delay, we're working on this and other new features for the next maintenance of TeeChart for PHP. We expect to post it in few weeks. We'll try to post it as soon as possible. I'll also notify you.
not for the moment, sorry for delay, we're working on this and other new features for the next maintenance of TeeChart for PHP. We expect to post it in few weeks. We'll try to post it as soon as possible. I'll also notify you.
Pep Jorge
http://support.steema.com
http://support.steema.com