PHP Classes
elePHPant
Icontem

HTML Bar Chart: Produces pure HTML code to display a'la bar chart

Recommend this page to a friend!

  Author Author  
Name: Slava Ivanov <contact>
Classes: 4 packages by
Country: Canada Canada
Age: 49
All time rank: 532 in Canada Canada
Week rank: 998 Down17 in Canada Canada Down


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
BARCHART Class:

The class produces pure HTML code to display a'la bar chart. It will work in any browser, with or without styleseet and it doesn't required GD library installed on your server at all.

MULTIBARCHART Class:

The class produces pure HTML code to display multiple a'la bar chart, based on BARCHART class.

Details
{startverticalbanner}
BARCHART Class:

The class produces pure HTML code to display a'la bar chart. It will work in
any browser, with or without styleseet and it doesn't required GD library
installed on your server at all!

HOW TO:

1. Copy class BARCHART to your includes directory.
2. Create PHP script that will include this class:
	include("barchartclass.inc");
3. Make instance of the BARCHART object:
	$bar = new BARCHART();
4. Use all "set" methods to initialize parameters of bar
	$bar->setMaxPoint(1000);
5.  Use getBar method to get result
	$bar->getBar();


OPTIONS AND FEATURES:

1. In constructor of the class you have parameters with default values.
	BARCHART($min_point = 0, $curr_point = 0, $max_point = 0, $init_strbeforebar = "", $init_strafterbar = "")

	$min_point - value to start count from (minimum value, ex.: 0).
	$curr_point - current value, should be between minimum and maximum values (ex.: 55).
	$max_point - value to finish count (maximum value, ex.: 100).
	$init_strbeforebar - Anything that you want to see before output bar (caption, title...).
	$init_strafterbar - Anything that you want to see after output bar (values, words ...).
2. You may change any of parameters at any time, without create additional instances
of object:
	$bar->setMinPoint("20");
	$bar->setCurrPoint("111");
	$bar->setMaxPoint("320");
	$bar->setStrBeforeBar("Today");
	$bar->setStrAfterBar("Good work");
3. There are few additional "set" methods of the class available, you may use it
to set "nice" look of bar:
	setIMGCompound($img_url) - set image to complete bar.
	setIMGBg($img_url) - set image to complete background.
	setColorBorder("black") - set border color around bar, if not specified won't be displayed.
	setColorCompound("red") - set color to complete bar.
	setColorBg("white") - set color to complete background.
	Note: If you use images, better to set background and compound colors same.
	setLengthBar("200") - set length of bar in percentage or in pixels ("100%" or "200").
4. Get methods available for this class:
	getPercentage($precision) - calculate percentage value of current point
	and return with precision specified.
	getBar() - return result horisontal bar


MULTIBARCHART Class:

The class produces pure HTML code to display multiple a'la bar chart, based on
BARCHART class.

HOW TO:

1. Copy class MULTIBARCHART to your includes directory.
2. Create PHP script that will include this class and BARCHART class:
	include("barchartclass.inc");
	include("multibarchartclass.inc");
3. Make instance of the MULTIBARCHART object:
	$chart = new MULTIBARCHART();
Note: You will automatically get access to all properties and methods of BARCHART
class.
4. Use all "set" methods to initialize parameters of chart
	$chart->setArrBeforeBar($captions);
5.  Use getChart method to get result
	$chart->getChart();


OPTIONS AND FEATURES:

1. In constructor of the class you have parameters with default values.
	MULTIBARCHART($init_min_point = 0, $init_curr_point = array(), $init_max_point = 0, $init_arrbeforebar = array(), $init_arrafterbar = array())

	$init_min_point - value to start count from (minimum value, ex.: 0).
	$init_curr_point - array of current values, each value should be between minimum
	and maximum values (ex.: 55, 34, 67).
	Important: size of this array defines size of chart.
	$init_max_point - value to finish count (maximum value, ex.: 100).
	$init_arrbeforebar - array with values, anything that you want to see before
	output each bar (array("test1", "test2", "test3")).
	$init_arrafterbar - array with values, anything that you want to see after
	output each bar.
2. You may change any of parameters at any time, without create additional instances
of object:
	$bar->setMinPoint("20");
	$bar->setArrCurrPoint(array("12", "45", "89"));
	$bar->setMaxPoint("320");
	$bar->setArrBeforeBar($array_captions);
	$bar->setArrAfterBar($array_numbers);
3. There are few additional "set" methods of the class available, you may use it
to set "nice" look of chart:
	setArrIMGCompound($array_img_url) - set array of images to complete bars.
	setArrIMGBg($array_img_url) - set array of images to complete backgrounds.
	setArrColorBorder($array_color_borders) - set set array of borders colors around bars.
	setArrColorCompound($array) - set array of colors to complete bars.
	setArrColorBg($array) - set array of colors to complete backgrounds.
	Note: if some array not specified will be displayed settings from BARCHART class.
	setDisplayPercentage(2) - set display percentage values with precision specified or not.
	setAlignBefore("right") - set align of word before bar (value: right, center, left).
	setAlignAfter("center") - set align of word after bar (value: right, center, left).
4. Get methods available for this class:
	getChart() - return result horisontal chart
5. + All methods from BARCHART class.

Author: Viatcheslav Ivanov, E-Witness Inc., Canada;
mail: ivanov@e-witness.ca;
web: www.e-witness.ca; www.coolwater.ca; www.strongpost.net;
version: 1.0 /11.22.2002

  Classes of Slava Ivanov  >  HTML Bar Chart  >  Download Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: HTML Bar Chart
Base name: barchart
Description: Produces pure HTML code to display a'la bar chart
Version: 1.0.0
PHP version: -
License: GNU General Public License (GPL)
All time users: 4835 users
All time rank: 546
Week users: 0 users
Week rank: 579 Equal
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image HTML HTML generation and processing View top rated classes
Group folder image Graphics Colors, images, charts and picture formats View top rated classes


  User ratings  
RatingsUtility Consistency Documentation Examples Tests Videos Overall Rank
All time: Good (83%) Sufficient (77%) Good (91%) Good (86%) - - Sufficient (67%) 580
Month: Not yet rated by the users

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Plain text file barchartclass.inc Class class file
Accessible without login Plain text file example1.phtml Example example use BARCHART class
Accessible without login Plain text file example2.phtml Example example use MULTIBARCHART class
Plain text file multibarchartclass.inc Class extends BARCHART class
Accessible without login Plain text file readme.txt Doc. documentation

Install with Composer Install with Composer - Download Download all files: barchart.tar.gz barchart.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.