Assertnfailure
09-11-2006, 03:44 AM
Hey, i made a fun general-purpose graph for a friend of mine, check it out:
http://www.schelterstudios.com/storage/graph2.html
http://www.schelterstudios.com/storage/graph.html
I designed it in such a way where you can style it by passing 3 parameters into its setStyle() method.
1) color of the line
2) bitmapdata object for the top section
3) bitmapdata object for the bottom section
Since it uses bitmapdata objects, you can use anything you want for the graph's appearance, as seen in the two examples I've listed above. It establishes a reference to the bitmapdata you pass in, so you can also alter them and see the effects appear in the graph itself as soon as it redraws itself.
As far as populating the graph goes, all you do is push in single number samples and it plots it at the end of the graph. It scales the data so the average lies across the middle of its y axis, but it scales down even further if outliers exceed the boundaries. You can also set a units string that is appended to the textfield showing the current sample values.
The graph itself is quite ideal for front-end display of server data, as it only updates itself as frequently is data is pushed into it, so the type of load it requires is all dependent on how you build the model to populate it.
http://www.schelterstudios.com/storage/graph2.html
http://www.schelterstudios.com/storage/graph.html
I designed it in such a way where you can style it by passing 3 parameters into its setStyle() method.
1) color of the line
2) bitmapdata object for the top section
3) bitmapdata object for the bottom section
Since it uses bitmapdata objects, you can use anything you want for the graph's appearance, as seen in the two examples I've listed above. It establishes a reference to the bitmapdata you pass in, so you can also alter them and see the effects appear in the graph itself as soon as it redraws itself.
As far as populating the graph goes, all you do is push in single number samples and it plots it at the end of the graph. It scales the data so the average lies across the middle of its y axis, but it scales down even further if outliers exceed the boundaries. You can also set a units string that is appended to the textfield showing the current sample values.
The graph itself is quite ideal for front-end display of server data, as it only updates itself as frequently is data is pushed into it, so the type of load it requires is all dependent on how you build the model to populate it.