In Excel and Powerpoint it is very easy to use the trendline function in a chart or graph to create a polynomial curve. Yet when I am in VB.net to create my custom graphs using the Graphics object and a bitmap I can not figure out how to do the same thing or even something similar. Has anyone ever attempted this? I feel like this basic drawing function shouldn't be that hard, yet here I am floundering.
Ultimately I have a list of sizes (x) and cost (y) for a widget. The cost increases when the size increase but not linearly. I want to use the polynomial curve to guess the cost of a widget where I know the size, but there is no cost for that size in my data set.
Asked
Active
Viewed 258 times
0

Chris
- 1
- 2
-
I see. The function returns the slope and intercept in the form a Tuple(of double, double). I just need to convert my array of points into an array of doubles for X and an array of doubles for Y. Nice! I bet I can do some fancy stuff my spiting my points into four quadrants and fit plotting each quadrant then using graphics.drawcurve to create a nice polynomial line. – Chris May 05 '20 at 22:51
-
I'm sure there are a number of third-party plotting tools for .NET that you could use, or you could spend the effort to roll your own. The primitives you would want are all there, but it will certainly require non-trivial effort to get a profession-looking result. Based on your comment, it looks like you're looking in the right places. – Craig May 06 '20 at 14:45