19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

282 <strong>Computer</strong> <strong>Programming</strong> <strong>Concepts</strong> <strong>and</strong> <strong>Visual</strong> <strong>Basic</strong><br />

Private Sub ShowTitle(radius As Single)<br />

Dim lbl As String, lblWid As Single<br />

‘Display title right below circle<br />

lbl = “Browser Market Share, July 1998”<br />

lblWid = picShare.TextWidth(lbl)<br />

Call Locate(-lblWid / 2, -(radius + .05))<br />

picShare.Print lbl<br />

End Sub<br />

FIGURE 9-23 Display from Example 5<br />

SUMMARY<br />

1. Data can be vividly displayed in line, bar, clustered bar, <strong>and</strong> pie charts.<br />

2. The programmer can select his or her own coordinate system with the Scale<br />

method.<br />

3. The Line method draws lines, rectangles, <strong>and</strong> solid rectangles. Styled lines can<br />

be drawn by assigning appropriate values to the DrawStyle property.<br />

4. The Circle method is used to draw circles, radius lines, <strong>and</strong> sectors. Each radius<br />

line is specified by a number between 0 <strong>and</strong> 1. The number 2 * π(or 6.283185)<br />

is used by the Circle method when drawing radii <strong>and</strong> sectors.<br />

5. The PSet method turns on a single point <strong>and</strong> is useful in graphing functions.<br />

6. The FillStyle property allows circles, sectors, <strong>and</strong> rectangles to be filled with<br />

one of eight patterns, <strong>and</strong> the FillColor property allows them to appear in<br />

assorted colors.<br />

PROGRAMMING PROJECTS<br />

1. Look in magazines <strong>and</strong> newspapers for four sets of data, one suited to each type<br />

of chart discussed in this chapter. Write programs to display the data in chart<br />

form.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!