Create bar chart using extjs and php
Sunday, January 31st, 2010In this tutorial, I will give examples of the usage of bar chart by using extjs and php. Generally, bar chart consists of the x-axis and y-axis in this tutorial I will provide a case study about the number of sales in each month, the x-axis represents the name of the month, while the y-axis represents the total sales of each month.
we first create a database with the name of “chart” after that create a table with a “sale”, tables of contents consists of two columns of “month” and “sumOfsel”, for more details on the source code can be seen below.
CREATE TABLE IF NOT EXISTS `sale` ( `month` int(11) NOT NULL, `sumOfsel` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
after create tables, enter data into a table, like the example below:
INSERT INTO `penjualan` (`month`, `sumOfsel`) VALUES (0, 1400), (2, 2000), (3, 4000), (4, 8000), (0, 30000), (1, 5000), (5, 14686);