PHP Classes

File: test_bar.php

Recommend this page to a friend!
  Classes of Miran Zagar   eBusiness Charts   test_bar.php   Download  
File: test_bar.php
Role: Example script
Content type: text/plain
Description: Test script
Class: eBusiness Charts
Wrapper around eBusiness charts generation service
Author: By
Last change: ID Change
Date: 19 years ago
Size: 4,493 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test eB/Charts php class</TITLE>
<style type="text/css">
<!--
  .tbhead { color: #000000; font: 15pt Tahoma, Arial, Helvetica, sans-serif; font-weight: bold }
  .label { color: #000000; font: 8pt Tahoma, Arial, Helvetica, sans-serif; font-weight: bold }
  th { color: #000000; font: 15pt Tahoma, Arial, Helvetica, sans-serif; font-weight: bold }
  td { color: #000000; font: 8pt Tahoma, Arial, Helvetica, sans-serif; font-weight: bold }
-->
</style>

</HEAD>
<BODY>
<?
require_once ("class_ebcharts.php");
//////////////////////////////////////////////////////////////
//
// please change YOUR_ID to ID received after registration
//
// if you do not have your ID please get one from
// http://charts.eb-mon.net
//
////////////////////////////////////////////////////////////////

$labels_a='Jan,Feb,Mar,Apr,Maj,Jun,Jul,Avg,Sep';
$data_a='5,16,8,9,11,11,30,25,33';

$labels=array("first","second","third","fourth","fifth");
$da=array(10,20,30,25,28);
$db=array(11,18,26,21,22);

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","bar",500,300);
$b->add_value($da,'aaa');
$b->add_value($db,'bbb');
$b->add_value($db,'ccc');
$b->add_value("9,11,33,26,26",'dddd ddd ddd');
$b->add_label($labels);
$b->show_agr_values();
$b->show_legend();
$b->draw();
echo
"<HR>";
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","bar",500,300);
//data
$b->add_value_line($da,'aaa');
$b->add_value($da,'aaa');
$b->add_value($db,'bbb');
$b->add_value($db,'ccc');
$b->add_value("9,11,33,26,26",'dd');
$b->add_label($labels);
$b->set_title("TEST chart");
// formating
$b->set_color_table('#FF6699,#CCFF99,0x993366,0x003399,0x339900,#FFFF66,#FFaa66');
$b->enable_stack();
$b->enable_3d(8);
$b->show_agr_values();
$b->set_rm(4);
$b->set_tm(19);
$b->show_legend();
$b->draw();
echo
"<HR>";
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","bar",400,200);
$b->add_value('10,20,30,25,33,30,25,33,10,20,30,25','aaa');
$b->add_value('10,20,30,25,33,10,20,30,25,33,11,22','bbb');
$b->add_value('5,6,8,9,11,11,30,25,33,10,20,30','ccc');
$b->add_label("Jan,Feb,Mar,Apr,Maj,Jun,Jul,Avg,Sep,Okt,Nov,Dec");
$b->set_color_table('0x339966,0x999900,0xcc3300,0x669999,0x993333');
$b->show_percentage();
$b->show_legend();
$b->draw();
echo
"<HR>";
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","bar",500,300);
$b->add_value_line($da,'line ');
$b->add_value($da,'aaa');
$b->add_value($db,'bbb');
$b->add_value($db,'ccc');
$b->add_value("9,11,33,26,26",'dd');
$b->add_label($labels);
$b->set_title("Glavni opis grafikona");
$b->set_left_text("Opis levo");
$b->set_bot_text("Tekst spodaj");
$b->enable_headers();
$b->set_color_table('0xff66ff,0x99ffff,0xffcc33,0xcccccc,0xcc9999,0x339966,0x999900,0xcc3300,0x669999,0x993333');
$b->enable_stack();
$b->enable_3d(6);
$b->show_agr_values();
$b->set_rm(4);
$b->set_tm(21);
$b->show_legend();
$b->draw();
echo
"<HR>";
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","bar",500,300);
//data
$b->add_value_line($da,'line');
$b->add_value($da,'aaa');
$b->add_value($db,'bbb');
$b->add_value($db,'ccc');
$b->add_value("9,11,33,26,26",'dd');
$b->add_label($labels);
$b->set_title("TEST chart");
// formating
$b->set_color_table('#FF6699,#CCFF99,0x993366,0x003399,0x339900,#FFFF66,#FFaa66');
$b->enable_stack();
//$b->enable_headers();
$b->enable_3d(8);
$b->show_agr_values();
$b->show_horizontal();
$b->show_values();
$b->set_rm(4);
$b->set_tm(10);
$b->show_legend();
$b->draw();
echo
"<HR>";

?>
</BODY>
</HTML>