Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts.

Slides:



Advertisements
Similar presentations
DAY 8: MICROSOFT EXCEL – CHAPTER 5 Aliya Farheen February 5, 2015.
Advertisements

Chapter 2 Organizing Data Understandable Statistics Ninth Edition
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 2 Exploring Data with Graphs and Numerical Summaries Section 2.2 Graphical Summaries.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. Lecture Slides Elementary Statistics Eleventh Edition and the Triola.
8.1 Types of Data Displays Remember to Silence Your Cell Phone and Put It In Your Bag!
Graphic representations in statistics (part II). Statistics graph Data recorded in surveys are displayed by a statistical graph. There are some specific.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.Copyright © 2010 Pearson Education Section 2-3 Histograms.
Chapter 2 McGraw-Hill/Irwin
1 Probabilistic and Statistical Techniques Lecture 3 Dr. Nader Okasha.
FIRST COURSE Excel Tutorial 4 Working with Charts and Graphics.
Copyright © 2001 by Wiley. All rights reserved. Chapter 8: Security, Menus, and Files Security Menu Systems Creating a Memo Editor Using the Clipboard.
COMPREHENSIVE Excel Tutorial 4 Working with Charts and Graphics.
Guilford County SciVis V105.01
Presentation of Data.
Chapter 2 Frequency Distributions and Graphs 1 © McGraw-Hill, Bluman, 5 th ed, Chapter 2.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 2 Descriptive Statistics: Tabular and Graphical Methods.
Graphical Displays of Data Section 2.2. Objectives Create and interpret the basic types of graphs used to display data.
Frequency Distributions and Graphs
Charts and Graphs V
STATISTICAL GRAPHS.
McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 Describing Data: Frequency Tables, Frequency Distributions,
Graphing. The Important Elements of a Graph  Horizontal Axis (X-Axis)  The Independent Variable. A change in this variable affects the y variable. 
C51BR Applications of Spreadsheets 1 Chapter 16 Getting Started Making Charts.
Graphing in Science Class
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Chapter 2 Descriptive Statistics: Tabular and Graphical Methods.
Business Statistics: Communicating with Numbers By Sanjiv Jaggia and Alison Kelly McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc.
 Frequency Distribution is a statistical technique to explore the underlying patterns of raw data.  Preparing frequency distribution tables, we can.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Graphs An Introduction. What is a graph?  A graph is a visual representation of a relationship between, but not restricted to, two variables.  A graph.
A Picture Is Worth A Thousand Words. DAY 7: EXCEL CHAPTER 4 Tazin Afrin September 10,
Describing Data: Frequency Tables, Frequency Distributions, and Graphic Presentation Chapter 2 McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies,
Chapter 2 Organizing Data Understanding Basic Statistics Fifth Edition By Brase and Brase Prepared by Jon Booze.
BASIC GRAPHS VISUAL REPRESENTATIONS OF DATA. OVERVIEW Information can be represented quickly and efficiently Information can be presented more attractively.
Graphing Data in Science Looking for a pattern. Why use a graph? Easier to analyze data Visualize patterns in the data Looks for trends.
Excel chapter 4.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Section 2-2 Frequency Distributions.
Chapter 2 Section 3 Using Scientific Measurements Graphs & Tables: Key Features and Reading.
When data is collected from a survey or designed experiment, they must be organized into a manageable form. Data that is not organized is referred to as.
Graphing Tutorial William Hornick CS 101. Overview You will be given a brief description, example, and “how to create” for each of the following: You.
A graphical display should: Show the data Induce the viewer to think about the substance of the graphic Avoid distorting the message.
EXCEL CHARTS. CHARTS Charts provide a way of presenting and comparing data in graphical format. Embedded charts or chart sheets Embedded charts are objects.
Chapter 2 Describing Data: Frequency Tables, Frequency Distributions, and Graphic Presentation McGraw-Hill/Irwin Copyright © 2010 by The McGraw-Hill Companies,
DAY 6: MICROSOFT EXCEL – CHAPTER 3 Sravanthi Lakkimsetty September 2, 2015.
© Copyright McGraw-Hill CHAPTER 2 Frequency Distributions and Graphs.
2.2 ORGANIZING QUANTITATIVE DATA OBJECTIVE: GRAPH QUANTITATIVE DATA Chapter 2.
Excel Chapter 3: Excel Charts Objectives Decide which chart type to create Create a chart Change the chart type Change the data source and structure Apply.
Understandable Statistics Seventh Edition By Brase and Brase Prepared by: Lynn Smith Gloucester County College Chapter Two Organizing Data.
Understanding Basic Statistics Fourth Edition By Brase and Brase Prepared by: Lynn Smith Gloucester County College Chapter Two Organizing Data.
Understanding Basic Statistics
Chapter 2 Frequency Distributions and Graphs 1 Copyright © 2012 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Recording Information Scatter Graph Line Graph Bar Chart Pictogram Pie Chart Useful Websites Other forms Of recording.
MATH 2311 Section 1.5. Graphs and Describing Distributions Lets start with an example: Height measurements for a group of people were taken. The results.
Copyright © 2014 Pearson Education. All rights reserved Picturing Distributions of Data LEARNING GOAL Be able to create and interpret basic.
Excel Part 4 Working with Charts and Graphics. XP Objectives Create an embedded chart Work with chart titles and legends Create and format a pie chart.
Excel Part 4 Working with Charts and Graphics. XP Objectives Create an embedded chart Work with chart titles and legends Create and format a pie chart.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
GRAPHING NOTES Understanding and constructing graphs.
Graphing A step by step method. Line Graphs  A line graph is a style of chart that is created by connecting a series of data points together with a line.
Section 12.2 Picturing Data Math in Our World. Learning Objectives  Draw bar graphs and pie charts.  Draw histograms and frequency polygons.  Draw.
By Christy Quattrone Click to View Types of Graphs Data Analysis, Grade 5.
Describing Data: Frequency Tables, Frequency Distributions, and Graphic Presentation Chapter 2 Copyright © 2011 by the McGraw-Hill Companies, Inc. All.
Descriptive Statistics: Tabular and Graphical Methods
Graphing Biology Fall 2016.
Lecture 3 part-2: Organization and Summarization of Data
GRAPHING Biology Fall 2016.
Key Questions When do you use different chart types?
Graphing Notes Graphs and charts are great because they communicate information visually. For this reason, graphs are often used in science, newspapers,
Data Management Learning Goals:
Graphing Notes Graphs and charts are great because they communicate information visually. For this reason, graphs are often used in science, newspapers,
TERMS AND CONDITIONS   These PowerPoint slides are a tool for lecturers, and as such: YOU MAY add content to the slides, delete content from the slides,
Presentation transcript:

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 1 Chapter 11: Using Visual Basic to Create Graphics

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 2 Types of Graphics Graphics are very useful for handling data or information visually. Engineers use graphics to design machines and structures using CAD (computer-aided design) graphics. Artists use graphics to create images for both business and artistic purposes. We have already used clipart graphics created by others in some of our projects. A graphical representation of business data is referred to as analysis or business graphics.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 3 Types of Business Graphics Business graphics include such types as line, bar, and pie charts. Line charts are often used to show trends over time. The incline or decline of each line segment demonstrates the change in values on the vertical axis for each unit change on the horizontal axis. Bar charts can be used to compare quantities using vertical or horizontal bars, where the length or height of the bar represents each quantity. Pie charts can be used to compare parts of some quantity (budget, income, and so on) using a circular diagram. Scatter diagrams can be used to look for patterns in data.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 4 Creating Business Graphics with VB To plot mathematical equations or create business graphics, follow a six-step approach: –Decide on a type of control to use in creating the graphic. –Set up the coordinate system for the control. –Add horizontal and vertical axes to the control. –Add division marks and labels to the axes. –Draw the graphic on the control. –Add titles and legends to the graphic.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 5 Methods for Drawing Axes The picture box is one of a variety of controls that can be used for drawing graphics. The coordinate axis is set using the Scale method or the ScaleTop, ScaleLeft, ScaleHeight, and ScaleWidth properties. Straight lines can be drawn using the Line method, in which the beginning and ending values of the line are specified. The Line method is often used to draw axes for a graph. The AutoRedraw property must be used in the Form_Load event procedure to display the axes.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 6 The Scale Method Scale(HUL, VUL) - (HLR, VLR) where HUL = horizontal measure of the upper left- hand corner VUL = vertical measure of the upper left- hand corner HLR = horizontal measure of the lower right- hand corner VLR = vertical measure of the lower right- hand corner

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 7 The Line Method Object.line (HUL, VUL) - (HLR, VLR) where HUL = horizontal measure of the upper left- hand corner VUL = vertical measure of the upper left-hand corner HLR = horizontal measure of the lower right- hand corner VLR = vertical measure of the lower right-hand corner

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 8 Properties for Axes and Labels The CurrentX and CurrentY properties are used to determine the location of division marks and labels on the graph. The division marks are added to the axes with the Line control. The labels are added to the division marks with the Print method. The TextHeight and TextWidth properties are used to position the labels. The actual graph is plotted using the PSet method within a For-Next Loop. The increments in the loop must be kept small to avoid gaps in the graph.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 9 Adding Division Marks and Labels Determine the width of the label with the TextWidth property. Divide the label width by two and subtract the result from the current location to determine the value of CurrentX where the label should be added. Set the CurrentY for the label to the value at the bottom of the division marks. Add the label to the graph or chart with the picture box Print method.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 10 Charts for Vintage Videos Five different charts are going to be created for Vintage Videos: –a line chart for total rentals –line charts for the three types of rentals –a bar chart for total rentals –bar charts for the three types of rentals –a pie chart for distribution of total rentals

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 11 Steps for Creating Vintage Videos Charts The first step in creating a chart is to design the chart showing the axes and labels. The second step is to set the coordinate axes. This often involves using different scales for the vertical and horizontal axes and placing the origin off-center. The third step is to add the division marks and labels on the vertical and horizontal axes.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 12 Creating Line Charts Line charts are drawn using the Line method to connect the points on the chart. Titles are added to a line chart in a manner similar to that used to add labels. We can draw multiple lines on a chart by using the DrawStyle property to distinguish between the various lines. For multiple-line charts, a legend is also needed to show the purpose of each line.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 13 DrawStyle Property Constants and Values Line StyleVB ConstantValue SolidvbSolid0 DashvbDash1 DotvbDot2 Dash DotvbDashDot3 Dash Dot DotvbDashDotDot4 TransparentvbTransparent5

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 14 Creating Bar Charts Bar charts are drawn using the B (box) option with the Line method. The parameters for the Line method give the coordinates of the corners of the box. Multiple bars can be distinguished using the FillStyle property. A legend is added for multiple bars in much the same way as for multiple lines.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 15 FillStyle Property Options Fill StyleVB ConstantValue SolidvbFSSolid0 TransparentvbFSTransparent1 Horizontal LinesvbHorizontalLine2 Vertical LinesvbVerticalLine3 Upward DiagonalvbUpwardDiagonal4 Downward DiagonalvbDownwardDiagonal5

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 16 Creating Pie Charts Pie charts are drawn using the Circle method, where the center of the circle and the radius determine the location and size of the circle. To draw the segments of the pie chart, we add parameters to the Circle method that will draw sectors rather than complete circles. These sectors are measured in radians. For the center of the circle to be connected to the sectors, the sector parameters must be negative. In a manner similar to that used for bar charts, the sectors can be filled using the FillStyle property and a legend can be added.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 17 The Circle Method object.Circle (x, y), radius, color, start, end where –x, y = the center of the circle –radius = the radius of the circle –color = the color for the circle –start = the starting point in radians for any sector of the circle –end = the ending point in radians for any sector of the circle

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 18 Three Steps to Create Pie Chart for Vintage Videos Compute cumulative fractions for each of three types of videos. Set the coordinate system for the form. Draw pie chart using Circle method.

Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts Circle Method Scatter Diagrams Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 19 Creating Scatter Diagrams Scatter diagrams help the user look for patterns in data. A scatter diagram can be drawn in Visual Basic by using the FillStyle property and the Circle method to draw circles. The circles are plotted for pairs of values, with the radius of each circle being set to a small fraction of the horizontal axis scale.