Graph is a simple C# graph-drawing API.
src/Graph.csto your project.
Initialise a new instance of
Graph(PictureBox, int), passing it the
PictureBoxin which to draw, and the maximum number of points that should be visible along the x-axis at any one time.
Graph graph = new Graph(pictureBox, 50);
You can set a few properties on your
Graph object that will modify its behaviour.
The statistic to display on the top-left of the graph, if anything. This is an enum with values
Nothing (no display),
Peak (the highest point visible on the graph at this instant), and
Average (the average y-value visible on the graph at this instant).
The color of the text displayed in the top-left corner, if there is any.
new Font("sans-serif", 12, FontStyle.Regular, GraphicsUnit.Pixel)
The font of the text displayed in the top-left corner, if there is any.
The color of the line drawn on the graph.
The thickness of the line drawn on the graph.
The one and only method you'll need. Adds a y-axis value to the graph.
Note that only positive values are supported. The point of origin of the graph is always the bottom-left corner.
Bugs or contributions