Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/shared/Graph/examples/bar_graph_1.php
<?php

	include("../BarGraph.php");

	$plot = new BarGraph(500,250,"Example Bar Graph (Solid)");

	$plot->set_data( array (
		"1900" => 207,
		"1901" => 55,
		"1902" => 96,
		"1903" => 118,
		"1904" => 229,
		"1905" => 95,
		"1906" => 13,
		"1907" => 58,
		"1908" => 87,
		"1909" => 175,
		"1910" => 19,
		"1911" => 282,
		"1912" => 189,
		"1913" => 255,
		"1914" => 79,
		"1915" => 54,
		"1916" => 253,
		"1917" => 259,
		"1918" => 211,
		"1919" => 289,
		"1920" => 193,
		"1921" => 131,
		"1922" => 252,
		"1923" => 156,
		"1924" => 288,
		"1925" => 265,
		"1926" => 133,
		"1927" => 198,
		"1928" => 132,
		"1929" => 13,
		"1930" => 152,
		"1931" => 125,
		"1932" => 88,
		"1933" => 284,
		"1934" => 6,
		"1935" => 175,
		"1936" => 89,
		"1937" => 159,
		"1938" => 187,
		"1939" => 176,
		"1940" => 158,
		"1941" => 41,
		"1942" => 225,
		"1943" => 18,
		"1944" => 100,
		"1945" => 224,
		"1946" => 169,
		"1947" => 51,
		"1948" => 148,
		"1949" => 237,
		"1950" => 77,
		"1951" => 245,
		"1952" => 261,
		"1953" => 106,
		"1954" => 57,
		"1955" => 99,
		"1956" => 135,
		"1957" => 296,
		"1958" => 217,
		"1959" => 200,
		"1960" => 54,
		"1961" => 65,
		"1962" => 280,
		"1963" => 198,
		"1964" => 202,
		"1965" => 263,
		"1966" => 8,
		"1967" => 1,
		"1968" => 293,
		"1969" => 94,
		"1970" => 220,
		"1971" => 79,
		"1972" => 263,
		"1973" => 139,
		"1974" => 176,
		"1975" => 281,
		"1976" => 287,
		"1977" => 39,
		"1978" => 66,
		"1979" => 83,
		"1980" => 241,
		"1981" => 271,
		"1982" => 158,
		"1983" => 239,
		"1984" => 191,
		"1985" => 145,
		"1986" => 191,
		"1987" => 172,
		"1988" => 194,
		"1989" => 276,
		"1990" => 180,
		"1991" => 277,
		"1992" => 178,
		"1993" => 25,
		"1994" => 78,
		"1995" => 75,
		"1996" => 150,
		"1997" => 229,
		"1998" => 114,
		"long this that1999" => 189,
	) );

	$plot->set_bgcolor("white");

	$plot->set_x_axis_title("Years");
	$plot->set_y_axis_title("Number of apples");
#	$plot->set_x_axis_label_font(2);
	$plot->set_y_axis_show_grid(true);
#	$plot->set_x_axis_label_up(true);

	$plot->set_margin(1,5,1,1);
	$plot->set_x_axis_position("bottom");
	$plot->set_y_axis_min_value(0);
	$plot->set_y_axis_max_value(300);
	$plot->set_x_axis_min_value(1900);
	$plot->set_x_axis_max_value(1990);
	$plot->set_x_axis_num_ticks(10);
	$plot->set_y_axis_num_ticks(6);

	$plot->set_bar_spacing(0);
	$plot->set_bar_gradient(false);
	$plot->show_bar_border(false);

	$plot->draw();
Return current item: TVEz - Media Library