Auto Spacing Labels in 2D Graph 
Author Message
 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?



Mon, 31 Oct 2011 08:18:51 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Space Space Space Space Space Space Space

2. Space Space Space Space Space Space Space

3. Space Space Space Space Space Space Space

4. Graphing 2d or 3d equasions.

5. 2D Graph in VB Standard Edition

6. Graph control 2D bar chart problem?

7. Plotting 2D XY Graph using MSChart Control

8. auto fill datagrid space (winforms - VB)

9. How to adjust X-axis spacing in graph????

10. Auto label/Caption change

11. Moving Label in MS Graph

12. Top, Left positions of Label within MS Graph ?!!!

 

 
Powered by phpBB® Forum Software