Degrafa Pie Chart

A friend of mine asked if it was possible to create a pie chart component using Degrafa instead of using the Flex pie chart component. Before this I had only looked at a few Degrafa samples but had never actually tried to create anything using their classes. I hummed and hawed and wondered how I would come up with something useful that looked good and functioned properly.

After a few hours of tinkering around and getting the basics of Degrafa down I came up with a rough first pass at a pie chart. A few more hours of how to build in the right functionality for handling different sized data sets and interpolating the data when the data sets changed and I came up with my first version (follow this link to see the source code) of a functional pie chart. For a first pass I'm pretty happy with how it turned out. There is still obviously a lot to add in, like labels and event handling, but the basics are there. Overall the learning process was not to painful.

The Degrafa docs are little lacking in places, especially when it comes to creating objects that can fire events (ie click, mouse over). Thankfully they have a ton of good samples and by picking apart some of the source code I was able to figure out some things the documentation did not really cover.

 

Click here to get to the source code.

Now that I have the basic of a decent chart component in place I will hopefully find some time to build in some additional features and also create some additional charting components like a bar and line graph. Stay tuned for more details.

7 Comments:

  1. Jason

    Derrick,

    Slick !! Is all I can say. This is a great example. The doc's will improve with time we are still only at beta 2. I look forward to seeing the other work your doing in this area.

    Great work keep it up!

    -jason

  2. Tom

    Derrick,

    I second Jason's comment. Fantastic job. Very simple and clean (visually AND the code itself.) Quite a refreshing change from the Flex Charts themselves.

    - Tom

  3. hsTed

    Nice work!

  4. Dan Wilson

    Derek,

    It seems like the view source link is broken on the swf. Would you please have a look?


    DW

  5. Greg Hardy

    Wow, I had the same problem lately and I must admit that your solution works great, thak you so much for the good jog you've made! :)

  6. Ben Dawkins

    Very nice and neat work. I've always advocated solutions that are both simple and effiective and your code meets both these requirements :)

  7. Kamil

    Looks very clean. Professional work :)


Leave a comment

Name: (required)

Email: (required)

URL:

Captcha test: (required)
Comments: (required)