Monday, April 16, 2012

Building a scatterplot class

Here is the way that I think a scatter plot should be built in C# (at a decently high level of abstraction).




  1. Create a blank image

  2. Use TextRenderer to draw the axis labels and scales (horizontal will not be so trivial, but will still be manageable).

  3. Draw some lines that will be the ticks on the axes and the lines for the axes themselves

  4. Draw some circles (not 100% of how to do that, but it can't be too hard) based on the points listed in some data-set.

  5. Display the image in a pictureBox.

  6. Create a function that will be called on MouseHover that will display some details about that point in a tool-tip.



Does this even make sense? Am I using the wrong controls for the job? Is there some code in .NET that will do a large part of this already (the chart class seems good only for bar graphs)? Is there a way to access excel's plotting capabilities from C#?



To me, all of this seems quite contrived, and I would appreciate input on how to better design a scatter-plot class.





No comments:

Post a Comment