Would you like a slice of pie?
Web August 26th, 2007
All businessman are crazy about the pie chart. Here is Pie3D powered by dojox.gfx3d. The interface for the end-user is pretty similar with dojox.chart.bar3d: just add the data via addSeries, set the light, then call render, boo, you are all set.
There is a long design struggle between dojox.gfx and dojox.gfx3d. The 3D pie chart is a Cylinder, but crippled intentionally, for example, only rotation around Y axis is supported. Last but not the least, it is much easier for user to specify the rx, ry and height, instead of scratching their heads to find the right rotation angle. dojox.gfx would suffice.
On the other hand, dojox.gfx3d brings schedulers and reusable gradient from Cylinder. The schedulers may be essential if we want to highlight some slices by moving them a little bit away from the center. Plan to throw one away; you will, anyhow. dojox.gfx3d is selected. Please checkout the code.
Looks great!
It’s very useful.
I downloaded your sample, but i can’t see any chart.
my browser just shows me this
That’s all Folks!
And the debug window has the following
EXPERIMENTAL: dojox.gfx.svg — APIs subject to change without notice.
DEPRECATED: dojo.declare: for class ‘dojox.gfx.lighting.Model’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.scheduler.BinarySearchTree’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Object’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Scene’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Edges’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Orbit’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Path3d’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Triangles’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
DEPRECATED: dojo.declare: for class ‘dojox.gfx3d.Quads’ pass initializer function as ‘constructor’ property instead of as a separate argument. — will be removed in version: 1.0
Any ideas ?
Sumant:
Could you list your browser version, dojo version, dojox.gfx3d version?
Besides the DEPRECATED warning, have you seen any errors?
Thanks for sharing. But, 3D graphs are something that, as a printing expert, I do not always like. For example perspective foreshortening can give mis-leading information about data.
In the example here, there is a technical problem with the perspective, as well. The top of the graph should be lighter than the edges. I wonder if this is a problem with the render library or what. Take a closer look and see if you see what I mean.
BTW, in the 2D realm and w. Python I prefer matplotlib.
Regards, Brian Ray