views:

1593

answers:

4

I have a report that I built for a client where i need to plot x 0-100, y 0-100. Lets imagine I have these points:

0,0 2,24 50,70 100,100

I need to represent these as a smoothed line chart, as the application of it is a dot gain graph for printing presses.

Heres the problem. The line draws fine from 100,100 (top right) down to 2,24. But then what happens is from 2,24 to 0,0 the line curves out off the left of the graph and then to down to 0,0. Imagine it putting a point at -10,10.

I understand this is because of the generic bezier curve algoritm it is using and the large seperation of control points, thus heavily weighting it.

I was wondering however if anyone knows a way I can control it. I have tried adding in averaged points between the existing control points but it still curves off the graph as if its still heavily weighted.

The only other answer I can think of is custom drawing a graph or looking into dundas charts and using its GDI+ drawing support.

But before I go that route anyone have any thoughts?

+1  A: 
bkane
A: 

Thank you! I appreciate you taking the time to do that.

In reporting services, even adding small steps in the problem area creates very sharp curves off the edge. If I get some time today I will try to put up a sample.

But as far as the general problem goes, what you show above is exactly it. Thanks again.

mattlant
A: 

You could try using a cosine interpolation for the points in-between.

Nick
A: 

Heres the the thing. I know how to draw the curve manually. The problem lies in the fact that there is such a high weighting between 2 and 50. I tried to add points in at the lows and the mids but it was still bowing off the edge. I will have to go check out the source and modify the graph back and see if i can get a screenshot up.

right now I just have the graph stop at 2 until i can get this solved.

mattlant
That's not the worst idea - you have a serious inflection point at x=2. There honestly isn't a single curve that fits those points well. It would be perfectly reasonable to have a straight line from x=0 to x=2 and then your smooth curve from that point.
Bob Cross