Steelcase Dynamic Charts
My second C#.Net project came in the form of a request for an application that could generate bar charts and pie charts from data supplied from an outside source. The values, headers, and labels for each chart would be passed to a script, the script would generate the chart, and pass back an image. Unfortunately nobody, including the client, seemed to know where that data was going to come from or what format that data was going to use when passed to the script. In light of having very little to go on, I opted for allowing all the parameters to be passed on the querystring. The look-and-feel of the charts was first prototyped by a designer in Photoshop, and I did my best to generate charts that looked similar.
Many people have expressed the opinion that programmers must be really good at math. I laugh as I tell them that 99% of the math I do involves adding or subtracting one a whole bunch of times. The bar charts project provided me one of those rare opportunities to do some more complex math. The maximum value for the chart is calculated based on the highest value to be displayed. First the order of magnitude is found, then it is rounded up to get the maximum value for the chart. For example, if the highest value is 9, the chart will scale off of 10. If the highest value is 57, the chart will scale off of 100. Though a simple project, it was quite enjoyable to work on.
Getting the 3D effect on the pie charts was probably the trickiest part of this project. In fact, due to how the slices are drawn, there is a slight graphical glitch where the slices do not get drawn in the correct order to preserve completely the 3D effect. However time and budgetary constraints proved more important than figuring out an appropriate algorithm to correct this small graphical inaccuracy.



