The final curve might look quite awkward since the local fits probably won't match exactly at the points they have in common. The curve in figure 2 shows an extreme case. Generally you select the number of segments to be computed. This also determines the number of data points in each segment. You also select the order of the polynomial which is used in fitting each segment.
Most programs use cubic splines.
If there are only the minimum number of points per segment, the final curve will be forced exactly through each point. One way is to fit the data to a simple functional form, like a polynomial, and then to integrate that function analytically. The Trapezoid rule basically assumes that we connect adjacent data points with a straight line. An integration program would then add up the area of all of the trapezoids located between the integration limits. The larger the number of trapezoids, the smaller the error.