[PATCH] Pies don't honor drawable status of series
Currently the Pie code will take the last series that isn't the abscissa. This patch fixes checks that the series is drawable.
Code:
--- pPie.class.php.orig 2011-12-30 09:53:23.008393577 -0700
+++ pPie.class.php.fixed 2011-12-30 09:57:29.551745512 -0700
@@ -85,7 +85,7 @@
/* Try to find the data serie */
$DataSerie = "";
foreach ($Data["Series"] as $SerieName => $SerieData)
- { if ( $SerieName != $Data["Abscissa"]) { $DataSerie = $SerieName; } }
+ {if ( $SerieName != $Data["Abscissa"] && $SerieData["isDrawable"]) { $DataSerie = $SerieName; } }
/* Do we have data to compute? */
if ( $DataSerie == "" ) { return(PIE_NO_DATASERIE); }
@@ -338,7 +338,7 @@
/* Try to find the data serie */
$DataSerie = "";
foreach ($Data["Series"] as $SerieName => $SerieData)
- { if ( $SerieName != $Data["Abscissa"]) { $DataSerie = $SerieName; } }
+ { if ( $SerieName != $Data["Abscissa"] && $SerieData["isDrawable"]) { $DataSerie = $SerieName; } }
/* Do we have data to compute? */
if ( $DataSerie == "" ) { return(PIE_NO_DATASERIE); }
@@ -921,7 +921,7 @@
/* Try to find the data serie */
$DataSerie = "";
foreach ($Data["Series"] as $SerieName => $SerieData)
- { if ( $SerieName != $Data["Abscissa"]) { $DataSerie = $SerieName; } }
+ { if ( $SerieName != $Data["Abscissa"] && $SerieData["isDrawable"]) { $DataSerie = $SerieName; } }
/* Do we have data to compute? */
if ( $DataSerie == "" ) { return(PIE_NO_DATASERIE); }
@@ -1133,7 +1133,7 @@
/* Try to find the data serie */
$DataSerie = "";
foreach ($Data["Series"] as $SerieName => $SerieData)
- { if ( $SerieName != $Data["Abscissa"]) { $DataSerie = $SerieName; } }
+ { if ( $SerieName != $Data["Abscissa"] && $SerieData["isDrawable"]) { $DataSerie = $SerieName; } }
/* Do we have data to compute? */
if ( $DataSerie == "" ) { return(PIE_NO_DATASERIE); }
@@ -1497,4 +1497,4 @@
return(array($Data,$NewPalette));
}
}
-?>
\ No newline at end of file
+?>