c# - how to create a simple chart drawing library -


i have followin problem. task create simple chart drawing library(like windows charts example). have tried tu use graphics class there few problems approach. when using graphics have no control on things drawn. need way interact drawn objects - erase specific point or line view, or make mouse hover events. ask guidance how start.

sounds kind of homework question, here outline of how approach this:

you need create class type every different type of thing want draw, , have them inherent abstract base type. instance, might have class drawableobject, , circle : drawableobject, polygon : drawableobject etc, inside of abstract base class, define methods such paint(graphics g) , ishit(point p) or similar, because every time make change graphics, need clear , re-paint every item. way when keep drawableobject's in array, need iterate through them , call paint method on each. each painted object keep specifics within own class (such coordinates, size, etc)

this how started doing on winforms, although if can use wpf, include wpf control host , use wpf shape controls items can manipulated , wpf take care of repainting surface


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -