Further PHP Graphing

I’ve improved the php graphs project, improving the Chart and lineChart classes and adding the barChart class.  The lineChart now accepts x and y coordinates instead of just y coordinates as it previously did.  The data array is now input as follows:

add_data("Label", array(x1, y1, x2, y2, ... ,xN, yN), "#FFFFFF");

The tick mark creation is a little more accurate and less messy now also.  When running some tests on these classes on the command line, I received a warning saying that the toString function didn’t return a string like PHP was expecting.  Further research indicated that PHP expectsthat when overloading the toString function, that it will return a string and let PHP handle displaying the information, so I altered it to return the string instead of printing it.

The barChart class works similarly to the lineChart class in that you pass the bar labels (x coordinates), and then the values (y coordinates) in the same fashion as any other Chart child.

avgresolveinout2 group

This entry was posted in Work and tagged , , , . Bookmark the permalink.

Comments are closed.