12
I realize this thread is several months old so someone may have already discovered and corrected the items I have found but I thought I would report it anyway.
I found some functions that didn't work properly such as adding title to an axis and adding tick labels.
The problems I found were in /class/graphs/graphjpgraph.php
The first problem was in the function set_options_element_b. The following code contains my modifications:
function set_options_element_b ($graph, $option_element, $element) {
if (is_object($graph)){
if (!empty($option_element)){
foreach ($option_element as $key => $value){
$this->set_object_func($graph, $element, $key, $value);
}
}
}
return $graph;
}
The other problem was located in the function set_object_func. The comparison to determine if the passed $value parameter is an array was insufficient. An additional comparison was necessary to determine if the $value parameter was actually an associative array.
Here is the additional function I added:
function is_associative(&$array) {
$next = 0;
foreach ($array as $k=>$v) {
if ($k !== $next)
return true;
$next++;
}
return false;
}
Then in the third line of the set_object_func function the additional comparison was added for this situation.
function set_object_func($obj, $subelem, $finalele, $value){
if (is_object($obj)){
if (is_array($value)&&!in_array($finalele,$this->get_func_that_array())){
if (!$this->is_associative($value)&&!is_array($value[0])&&!is_array($value[1])&&!is_array($value[2])&&!is_array($value[3])&&!is_array($value[4])&&!is_array($value[5])&&!is_array($value[6])&&!is_array($value[7])){
.....
Now everything appears to be working but lots more testing to be done.