Documentation Home
Examples
Pie Charts
Overview
Customizing the chart
Function Reference
Examples
Line & Bar Graphs
Overview
Adding data
Customizing the bars
Customizing the axes
Function Reference
Support
Installation
Version History
Technical Support
Previous: pie_3d_edge1.example.phpNext: bar_example4.example.php

Example Chart: pie_example2.example.php

<?php
  include( 'chartlogix.inc.php' );
 
  $pie = new PieChart();
 
  //---- THE STYLE
 
  $pie->setBackground( 'EEEEFF', 'DDDDEE' );
  $pie->setPadding( 20 );
 
  $pie->setTitleStyle( 'arial.ttf', 15, '000000' );
  $pie->setTitlePosition( 0, 0 );
 
  $pie->setLegendWidth( 40.00 );
  $pie->setLegendTextStyle( 'arial.ttf', 12, 'FFFFFF', 10 );
  $pie->setLegendKeyStyle( 12, 5 );
  $pie->setLegendBoxStyle( '333366', '000000', 10 );
  $pie->setLegendPosition( 1, 0 );
 
  $pie->set3DEdgeStyle( 20, 50, false );
 
  $pie->setHoleSize( 40 );
 
  //---- THE DATA
 
  $pie->setTitle( 'ChartLogix Pie Chart' );
 
  $pie->addData( 'Apples', 593, '99FF00' );
  $pie->addData( 'Strawberries', 581, 'FF6600' );
  $pie->addData( 'Plums', 395, '9900CC' );
  $pie->addData( 'Bananas', 332, 'FFCC00' );
  $pie->addData( 'Grapes', 176, '009900' );
  $pie->addData( 'Others', 300, 'AAAAAA' );
 
  //---- DRAW PNG
 
  $pie->drawPNG( 500, 400 );
Home  |  Online Store  |  Documentation  |  ChartLogix Features  |  Terms & Conditions Copyright © 2024 CubeLogix Ltd