Archive for the ‘OO’ Category
gChartPhp – progress of a sort.
Posted by detour1999 | Filed under OO, google, nerdly, programming
Real quick:
I had less time than I wanted to to work on gChartPhp this weekend.
In that time I fixed a couple bugs (bar chart bar width calculation for one…) and got x-axis labels working.
I plan to get y-axis labelling working asap. The plan is to allow you to put labels for the y-axis, or just specify how many y-axis labels to have and let it calculate what those are.
That will have to wait until tomorrow.
Also:
Dhaval Patel did a bunch of work to version 2 of the code and got a lot more working. I have been stupidly busy and haven’t had a chance to even look at it, but I will probably put that code up (fully credited, of course) on google code when I commit the axis labelling stuff tomorrow.
So, not as much progress as I was hoping, but progress nonetheless.
-d.
better charts than yesterday.
Posted by detour1999 | Filed under OO, google, nerdly, programming
word.
More playing with the google chart API.
Second cut is somewhat more usable (at least for me).
Check out the “demo” (quotes, as it’s not much of a demo…)
- Limitations as it currently sits:
- no support for lxy, venn, or scatter-plots. lxy and scatter should be available soon… I’ll go into the venn diagram stuff later…
- scaling is in place, but kinda useless until I get axes marked correctly. That’s tops on my priority list for this.
- Some extras still need implementation (chart background, image background, data point markers, etc.)
werd it up.
I am kinda pleased with how the code is shaping up. I haven’t had much of an opportunity in the past to play with inheritence and polymorphism in PHP (blah, blah, blah…).
Currently I have it set up where like so (in terms of inheritence):
- gChart (the base chart class)
- gPieChart (has a simple set3D(bool) function)
- gLineChart
- gBarChart
- gStackedBarChart
- gGroupedBarChart
I will probably refactor that sometime soon. But, I’m happy with how it works currently.
I was concerned for a bit about how I would be losing the ability to change the chart type with one line of code (as I could [and did] with the first draft) by breaking chart types out into separate classes. The fact of the matter is that really, no one is very likely to be doing that anyway. So, better code at (perhaps) the sake of some usability…
My plan for next week: axes labeling, those last three chart types, and what’s left of the “extras”.
I put the latest class (gChart2.php) up on google code if anyone wants to see. I’m sure there are plenty of ugly things in there… I’m still getting used to a bunch of things.
-d.
ps.
Venn Diagrams. WTF?
according to the docs:
Supply one data set where:
* the first three values specify the relative sizes of three circles, A, B, and C
* the fourth value specifies the area of A intersecting B
* the fifth value specifies the area of B intersecting C
* the sixth value specifies the area of C intersecting A
* the seventh value specifies the area of A intersecting B intersecting C
Couple things…
Always three circles? No matter what? WTF?
The three circles are relatively sized, but the intersections are not? So nothing is to scale?
Like so: A=300, B=200, C=250, A∩B=10, B∩A=10, C∩A=0, A∩B∩C=0
…fucking nevermind.
those first three values (A, B, C) NEED to be scaled by the user. Anything over 100 will be 100. so, that example above, if those circles look equal, that’s cause they are. I should be able to have Venn Diagrams knocked out soon. UGH. Way too much time wasted trying to figure out wtf that “the relative sizes of three circles, A, B, and C” was supposed to mean.
Update: 12/9/07 21:26
Venn Diagrams are working and on that demo page.
I’m still non-plussed with the implementation. Whatever.
-d.
more charting…
Posted by detour1999 | Filed under OO, google, nerdly, programming
alright.
I’ve been playing with a php wrapper for the google chart API.
My first cut of it kinda sucks. But here it is…
- Limitations as it currently sits:
- only 1 data series per chart (yeah… I’m working on it…)
- scaling is not in place yet (had it working, then introduced a bug in arithmetic somewhere…)
- colors and “extras” haven’t been implemented yet. (They will be.)
werd up.
I will admit, it’s nice to use as an object.
More to come. My plan for tomorrow is: proper scaling, multiple data series, and all the “extras”.
(I put together a project on google code… I don’t have an SVN client on my mac yet, so I haven’t committed anything yet. I put the basic class in the downloads section, if anyone actually wants to see it.)
werd.
-d.
oo thanks.
Posted by detour1999 | Filed under OO, nerdly, programming, work
I’ve been thinking about object oriented development of late.
Ive been doing OO dev for about 8 years now… (C# for about 6 year, and VBA/VB6 for a couple before that, mostly windows apps.) I’m kinda ok at it.
Recently, i’ve been doing a lot more OO dev in other languages. (specifically js and php)
And it comes pretty easily…
…and I’ve been wondering why.
…
Also, it’s cold here in Chicago.and whenever it gets cold, I get sentimental and stuff…
…And i realized that I’ve been super lucky to have great co-workers to learn from.
so, that being said…
Jeff really realigned my thought process to an OO way of thought.
Mike and Rick help to make me passionate about doing OO as right as possible.
Brian got me thinking about OO on the web with a web appropriate language.
Harper gets me thinking about doing stuff outside of OO, and breaking my reliance on msft. (And gave me a shot at my new job @ skinnyCorp.)
Bryan refuses to ever take anything I say at face value, and forces me to really think about why we should do anything.
werd.
thanks guys…