I am using pChart to generate some charts and this working fine when run at the server but when I run the same on XMAPP I get this error:
Warning: Cannot assign an empty string to a string offset in ...\pDraw.class.php on line 4990
Fatal error: Uncaught Error: Cannot use string offset as an array in ...\pDraw.class.php:4991
The line referred to in pDraw.class.php is:
4990 if ( !isset($LastX[$Key] ) ) { $LastX[$Key] = ""; }
4991 if ( !isset($LastX[$Key][$Pos] ) ) { $LastX[$Key][$Pos] = $YZero; }
$Last is referred to earlier in the function as a string ($LastX = "";) and here it is being set to an array. If I add the following just before 4990:
var_dump($LastX);
echo " : Key = " . $Key;
if (!is_array($LastX)) {
echo " : Not array";
}
I get:
string(0) "" : Key = 3 : Not array
As said it works on the server side but I would like to get it working on XAMPP. I know I could use a different graph library but I am trying to understand this issue. Any ideas or is this just badly written?