Problems with Teechart PHP Source code
Posted: Tue Mar 03, 2009 12:56 am
I have been trying to generate a simple multiple series bar chart and having difficulty setting the Axis Labels.
I am using this method
from an arry to populate the Axis labels.
$teechart->getAxes()->getBottom()->getLabels()->getItems()->add($key,$val);
Where $key is an incrementing sequence and $val is text i.e "Q1 2005"
However the source code (and the obfuscated version)
return this exception:
PHP Fatal error: Call to undefined method ArrayObject::add() in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\teechart\axis\AxisLabelsItems.php on line 0
This is because AxisLabelsItems inherits from ArrayObject and there is no method add defined for ArrayObject or obviously the descendant class. Probably what is meant here is the parent::append() method of ArrayObject.
Scanning through the source code I think I found a second instance where this phantom add method was being called: SliceValueList::setSlice
public function setSlice($index, $value) {
while ($index >= sizeof($this)) {
parent::add(0);
}
if ( ((int)parent::offsetGet($index)) != $value) {
parent::offsetSet($index, $value);
$this->OwnerSeries->repaint();
}
}
The method from AxisLabelsItems is
public function add($value, $text=null) {
$result = new AxisLabelItem($this->iAxis->chart);
$result->iAxisLabelsItems = $this;
$result->setTransparent(true);
$result->setValue($value);
parent::add($result);
if ($text != null) {
$result->setText($text);
}
return $result;
}
I can obviously procede by editing the source code but there are multiple other errors appearing which in some cases are points where the code times out and nothing is ever rendered (Im using this in Delphi 4 PHP context, sometimes under a debugger but in any case the times can exceed 10 minutes.)
php[5612]
PHP Fatal error: Class 'TextShape' not found in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\teechart\styles\SeriesMarks.php on line 16
php[4716]
PHP Fatal error: Call to undefined method AxisLabelsItems::get() in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\teechart\axis\AxisLabelsItems.php on line 50
I suspect this might be another call that should be to ArrayObject::offsetGet
In any event I would like to confiorm the easiest way to add a barchart so that the Axis Labels can be populated with the apropriate text (these Axis labels represet Quarter-Year Combinations as above)
Secondly Im faced with mixing obfuscated files with edited source to keep this working: which src files enable the charting license.?
I am using this method
from an arry to populate the Axis labels.
$teechart->getAxes()->getBottom()->getLabels()->getItems()->add($key,$val);
Where $key is an incrementing sequence and $val is text i.e "Q1 2005"
However the source code (and the obfuscated version)
return this exception:
PHP Fatal error: Call to undefined method ArrayObject::add() in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\teechart\axis\AxisLabelsItems.php on line 0
This is because AxisLabelsItems inherits from ArrayObject and there is no method add defined for ArrayObject or obviously the descendant class. Probably what is meant here is the parent::append() method of ArrayObject.
Scanning through the source code I think I found a second instance where this phantom add method was being called: SliceValueList::setSlice
public function setSlice($index, $value) {
while ($index >= sizeof($this)) {
parent::add(0);
}
if ( ((int)parent::offsetGet($index)) != $value) {
parent::offsetSet($index, $value);
$this->OwnerSeries->repaint();
}
}
The method from AxisLabelsItems is
public function add($value, $text=null) {
$result = new AxisLabelItem($this->iAxis->chart);
$result->iAxisLabelsItems = $this;
$result->setTransparent(true);
$result->setValue($value);
parent::add($result);
if ($text != null) {
$result->setText($text);
}
return $result;
}
I can obviously procede by editing the source code but there are multiple other errors appearing which in some cases are points where the code times out and nothing is ever rendered (Im using this in Delphi 4 PHP context, sometimes under a debugger but in any case the times can exceed 10 minutes.)
php[5612]
PHP Fatal error: Class 'TextShape' not found in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\teechart\styles\SeriesMarks.php on line 16
php[4716]
PHP Fatal error: Call to undefined method AxisLabelsItems::get() in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\teechart\axis\AxisLabelsItems.php on line 50
I suspect this might be another call that should be to ArrayObject::offsetGet
In any event I would like to confiorm the easiest way to add a barchart so that the Axis Labels can be populated with the apropriate text (these Axis labels represet Quarter-Year Combinations as above)
Secondly Im faced with mixing obfuscated files with edited source to keep this working: which src files enable the charting license.?