I was working to help someone on the forums last week with debugging some issues with getting a chart dashlet up and running. As I was going thru this exercise, I realized one big thing… this is way too hard to do. Lots of code duplication is needed to get it running, and thus you are stuck with copying an existing chart dashlet and making the changes for your particular dashlet. Makes it rather hard for the average developer to get up and running, and forces you to do more reverse engineering than being able to concentrate on your data you are trying to display. So I decided to fix this :-).
I created a GitHub project over the weekend that provides an abstract class that does all the heavy weight work for each kind of chart provided out of the box, and leaving you to fill in the blanks with the needed chart properties and the dataset itself. Each dataset method in the classes has great PHPDoc comments on what the data structure should like that is being pushed into the chart. This should help any Sugar developer who has struggled building chart dashlets, enabling them to build them with ease.
Feel free to check out the source code, and definitely provide any feedback, fixes, or changes needed back via a pull request. And let me know if this helps making chart dashlets easier, and if it’s something you’d like to see incorporated in the product down the road.