Creating a 3D chart

Gazzo

Active member
Joined
Dec 31, 1969
Messages
25
Location
Durham, England
Hi all,

A while ago I created a simple line graph in notepad using GDI+ which was used in a web page. This wasnt to hard, but now I am interested in how I would create a 3D bar chart.

After looking around for info on 3D drawing, I have kind of came to the conclusion that I will need to use d3d. Is this correct, or is there a way to do it only with GDI+.

Can anybody shed some light, also, if anybody knows of any sources of info, i.e. web sites or books, could you let me know.

Cheers,
Gazzo
 
While you *could* do it in GDI+, youd be doing all the 3D work yourself. Its not terribly complex, but if you want rotation, changing perspective, etc., its NOT going to be trivial.

If you want to code it yourself youre probably going to want to use Direct3D (as you guessed). If you look at the DirectX8 (not DX9) samples, youll find a Bar Graph sample done in VB6 that includes a "picker" - as you hover over each bar it gives the numbers in a floating tooltip. You can rotate, zoom, etc. in the VB6 sample.

Obviously, youll have to convert the whole thing to DirectX9 if you want to do it in .NET but it shouldnt be that hard (except for maybe the "picking" part).

-Ner
 
Back
Top