0% found this document useful (0 votes)
50 views2 pages

Scientific Graphics: The Mschart Control

The document discusses using graphics and charts to present scientific data. It focuses on the MSChart control, which allows creating Excel-like charts in applications. It describes properties of the MSChart control like AllowSelections, AllowSeriesSelection, and ChartType that control user interaction and the type of chart created.

Uploaded by

Zephir AWT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

Scientific Graphics: The Mschart Control

The document discusses using graphics and charts to present scientific data. It focuses on the MSChart control, which allows creating Excel-like charts in applications. It describes properties of the MSChart control like AllowSelections, AllowSeriesSelection, and ChartType that control user interaction and the type of chart created.

Uploaded by

Zephir AWT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CHAPTER 10

Scientific Graphics
GRAPHICS ARE HIGHLY USEFUL TOOLS forpresenting data. Whether for a plot Of a math-
ematical function, a bar graph displaying data, or a schematic diagram, graphics
can help researchers support and explain their theories and findings. This
chapter explains how to use the Microsoft Chart control to integrate data
presentation capabilities within your applications. You'll also look at the new
System.Drawing namespace in VB .NET, and explore using it to create a function-
plotting program.

The MSChart Control


Readers who have dealt with Microsoft Office Visual Basic for Applications (VBA)
might be familiar with the MSChart control; Office developers often use this
general-purpose graphing control. With this control, you can create Excel-like
charts from your application data and display these charts on a form. You have
the flexibility to create a variety of 2-D and 3-D charts, including, but not limited
to, bar graphs, pie charts, and line graphs. Additionally, you can control chart and
axis labels, as well as axis tick mark increments and a variety of other features.
The resultant charts created by this control look similar to Excel, but keep in
mind that the MSChart control lacks Excel's level and variety of options. You
should remain open to saving your data in a format that you can later import into
Excel for charting. However, this control meets most basic graphing needs and
provides a highly useful tool for creating independent graphing solutions. You'll
begin learning about this useful control by examining its most useful properties.

NOTE The MSChart control originated as a subset of the Graphics Server


control's capabilities, which are discussed in Chapter 3.

C. Frenz, Visual Basic and Visual Basic .NET for Scientists and Engineers
© Christopher Frenz 2002
221
Chapter 10

The MSChart control isn't part of the standard VB toolbox. To select it in


VB 6.0, go to the Project menu and choose the Components option. Next, select
the Microsoft Chart Control from the Controls list. In VB .NET, go to the Tools
menu, select the Customize Toolbox option, and then select the Microsoft Chart
control from the COM Components list.

The MSChart Control Properties


The following sections describe in more detail the MSChart control properties.

The AllowSelections Property


This property determines whether users can select different chart elements. For
example, you can allow users to select chart titles, axis labels, and legend ele-
ments when this property is set to True. An upcoming example illustrates how
such user selections can dynamically alter selected elements.

The AllowSeriesSelection Property

This property is somewhat similar to the AllowSelections property, except it deals


with the actual data presented in the chart and not labels and other elements.
When set to True, a user can click a single data point and in the process select the
whole data series.

The ChartType Property


Probably one of the most important properties, ChartType dictates what type of
chart is created and displayed. Table 10-1 shows you the chart types you can
choose from by specifying various VB constants for ChartType.

222

You might also like