ASP. NET 3.5 chart controls (1)

Source: Internet
Author: User

BKJIA quick translation: charts display information in an easy-to-understand manner. net Applications Support charts. net SP1 and Visual Studio 2008 provide a plug-in to support strong charts and no longer have to spend money on expensive, proprietary software. To create the charts mentioned in this article, you need to install Microsoft Chart Controls for Microsoft. NET Framework 3.5 and Microsoft Chart Controls add-on for Microsoft Visual Studio 2008. If you are not familiar with charts, read this article carefully.

ChartAreas

The ChartAreas attribute is a collection of ChartArea objects. ChartArea is responsible for displaying the attributes of the container or the background of the chart. Because there are more than one, this means that the MSChart control can contain multiple charts.

When using multiple ChartAreas, it is very important to understand the following:

Technically, the location of ChartArea can be controlled, so multiple ChartArea can be superimposed, but this is not recommended. We recommend that you draw them in an independent area of the MSChart control, to merge or overwrite data points, we recommend that you use multiple sequences in a ChartArea, which will be described later. By default, the widget automatically adjusts the size and position for you.

A single ChartArea will be adjusted independently to adapt to the data. As shown in, the Y value in the second ChartArea is larger and there are fewer data points.

Multiple ChartArea allows you to use multiple incompatible ChartTypes sequence object attributes to control the chart display type, such as bar, column, and pie chart, the chart is displayed in the same MSChart control.

For a single ChartArea, you can set and adjust many independent attributes so that you can adjust the chart area to meet different needs. Most of its attributes are similar to those of the panel control, so here we will not talk about it. Let's just talk about the unique attributes of ChartArea. Below is a list of these unique attributes:

3D Style: Using the Area3DStyle attribute and sub-attribute of ChartArea, we can create beautiful and eye-catching 3D charts. Enable3D attributes must be set to TRUE either in the designer or in the code, other parameters can make an image look 3D by adjusting the rotation, angle of view, lighting mode, and other 3D elements.

 

Coordinate Axis Control and Style: The Coordinate Axis set includes the X and Y axes, and the second X and Y axes. The attributes of these four items allow you to set the style, label, interval, tooltip, and zoom, if your icons require precise intervals, labels, or other special display requirements, you can use these attributes. For example, you can reverse the value of the coordinate axis or control how labels are displayed on the X axis. If you use charts to display real-time information, you can use the IntervalType attribute to configure the display of data points based on date and time.

Select cursor: If you are very interested in using the mouse to select data points or click and drag ranges, you need to use the CursorX and CursorY attributes. You can enable the selection, and set the initial cursor position or range.

Series

Like the ChartAreas attribute, the Series attribute is a set. A single ChartAreas instance has three important attributes: ChartArea attribute, ChartType attribute, and Points set attribute.

ChartArea: identify which ChartArea to use.

ChartType: identifies the icon type used to represent data. The basic types include bar, column, pie, and line. There are also some advanced options, such as a line chart, a curve chart, and a tracing chart.

Points: a set of DataPoint objects, including x and y values. They are part of the sequence drawn on the chart. The most common method to increase data Points when data is bound is used, this article will introduce you later.

Other common attributes on Series instances are also widely known:

Color: This attribute is used to separately set the Color of each data point sequence. By default, this attribute is blank and the control automatically changes the Color to ensure that multiple sequences are separated.

IsValueShownAsLabel: set the value of this attribute to TRUE and the default value is FLASE). The chart displays the Y value of each data point.

 

When multiple sequence instances are merged into a ChartArea, for example, the following two independent charts, each of which contains six data points.

 

Suppose you want to compare the data points in the two charts, you can put the two MSChart controls together, and you can also use two ChartAreas in a chart, these two methods are fine, but they cannot give you good visual effects. This is why MSChart combines data points so that you can compare data side by side. Add the data in the second chart as the second sequence instance to the first chart, and then visually improve the comparison effect.

 

When multiple sequence instances are used, it is important to remember the ChartType used by each sequence. Not all ChartType options are compatible.

In general, the chart controls have the following layers: MSChart controls have zero to multiple ChartAreas, and one ChartAreas has zero to multiple Series), one sequence has zero to multiple data points DataPoints ).


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.