Added support for percentage display in pie chart

This commit is contained in:
unknown 2008-09-11 14:00:23 +02:00
parent cefdd9d6f1
commit 24cd80089b
2 changed files with 12 additions and 6 deletions

View File

@ -109,7 +109,7 @@ if ( isset($_GET['showpercent']) )
$content['showpercent'] = 0; $content['showpercent'] = 0;
} }
else else
$content['maxrecords'] = 10; $content['showpercent'] = 0;
// --- // ---
// --- BEGIN CREATE TITLE // --- BEGIN CREATE TITLE
@ -200,10 +200,16 @@ if ( !$content['error_occured'] )
// $p1->SetCSIMTargets($targ,$alts); // $p1->SetCSIMTargets($targ,$alts);
// Set label format // Set label format
$p1->SetLabelType(0); if ( $content['showpercent'] == 1 )
$p1->value->SetFormat("%d%%"); {
// $p1->SetLabelType(1); $p1->SetLabelType(0);
// $p1->value->SetFormat("%d"); $p1->value->SetFormat("%d%%");
}
else
{
$p1->SetLabelType(1);
$p1->value->SetFormat("%d");
}
// Set label properties // Set label properties
$p1->SetLabelPos(1.0); $p1->SetLabelPos(1.0);

View File

@ -49,7 +49,7 @@
<td class="line1">&nbsp;{showpercent_display}</td> <td class="line1">&nbsp;{showpercent_display}</td>
</tr> </tr>
<tr><td class="{cssclass}" colspan="2"> <tr><td class="{cssclass}" colspan="2">
<img src="{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&width={chart_width}&maxrecords={maxrecords}" width="{chart_width}" height="{chart_width}"> <img src="{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}" width="{chart_width}" height="{chart_width}">
</td></tr> </td></tr>
</table> </table>
<br><br> <br><br>