Rad & Dot Net - Digital Warrior

Assorted ramblings (and vents!!) from a techie on the sunny shores of Kenya, East Africa

Tuesday, May 10, 2005

Graphing GDI+

A project i'm working on requires quite a bit of charting. Which is no biggie. There are lots of free solutions. However I want to do some rather exotic things with the charts including
1) Multiple axes
2) More than one chart type superimposed on another e.g. bar on a line on an area
3) Render to web and screen
4) Support transparency
5) Support simple interactivity i.e. drill down
6) Output SVG, PNG and JPEG

Of all the existing one most can be eliminated because
- They don't do what I want esp 1,3 and 5
- Licencing issues (Excel, OWC). If you use this method on the web, every connecting client should have an office licence. Yikes!
- Cost
- Some problem or the other (ZedChart, NGraph, ChartDirector, etc)

The closest one i've found is- Dundas Charts. But the price has to be seen to be believed.

So i'm doing it myself with GDI+.

It's actually easier than I thought -- .NET support for drawing is simply first rate. The only annoying thing is that the origin, 0,0 is the top left corner. So the code to render the bars, lines, etc needs to factor this in when plotting the co-ordinates. But it's running like poetry.

So far so good - i've got bar charts running so next is the line, scattergram and pie

Drawing graphs is much trickier than it sounds, especially the approach i have taken -- doing it in layers. More on that later

0 Comments:

Post a Comment

<< Home