Auto Spacing Labels in 2D Graph

I wrote a simple graph program to use in a picturebox.

The number of plotted points may vary.

I would like to auto space the labels such that if there are 500 points the

X or Y labels are not so close together that the labels over write each

other, but if there are only 3 points then more space would appear between

the labels. All this needs to be dependent on the PBox Scale whether Pixel

or User Defined.

-------------------------------

The variables IMHO that are available are:

1) picturebox scale.Width

2) iDataPts = # of data points

3) LenAllLabels = LenAllLabels + picGraph.TextWidth(DataX(i + 1))

4) If picGraph.TextWidth(DataX(i + 1)) > LenLongestLabel Then

LenLongestLabel = picGraph.TextWidth(DataX(i + 1))

End If

5) Some fudge factor for spacing

-----------------------

But not sure how one would calculate or even if on the right track?