Charting Basics制作图表的基本知识
| Understanding Data Point, Its Argument and Value |
This topic provides general information about a chart's data point, and explains its argument and value(s).
本節提供圖表數據點的一般信息,解釋說明參數和值。
A chart's most fundamental element is a data point. A group of data points represents a single series. Points reside in the Series.Points collection, and no series is displayed until it has at least one data point specified.
圖表最重要的元素是數據點。一組數據點代表一個序列。點集位于Series.Points集合,集合不會顯示除非至少指定一個數據點。
Because XtraCharts supports numerous series view types, which represent and organize data in different ways, visual representation of a data point differs from one view to another. For details on this, refer to Understanding Series and Series Views.
因為XtraCharts支持很多種序列視圖類型,這種類型可以通過多種不同的方式展示和組織數據,一個視圖中可視化顯示的一個數據點與另一個視圖可能不同。了解更多,參閱Understanding Series and Series Views.
線性序列數據點 和條形圖數據點
Each data point must have specified one argument and at least one value, corresponding to it. In general, a pairing of an argument and its value is represented on a diagram's axes as their X and Y coordinates, respectively, as the following image demonstrates.
每一個數據點必須制定一個與之相關的自變量參數和至少一個值。通常情況下,一組參數和值顯示在一個圖的軸上,作為X坐標和Y坐標,如下所示。
Additional values are prescribed by certain view types (e.g. Financial and Bubble series). Visually, they are represented differently, depending on the particular view type.
In a chart's Legend, it's possible to represent either a separate series, or individual points of the series. For details on this, refer to Legend Overview.
特定類型的視圖類會有一些額外的值(比如金融和冒泡圖)。從視覺上說,他們完全不同,這要看它們的視圖類型。在圖表的圖例中,既可以顯示一個獨立的序列,也可以只是序列中個別的點。更多細節參考?Legend Overview.
To learn the ways data points can be created, refer to Manually Add Points to a Series.
For more information, refer to Series Points.
| Understanding Series and Series Views |
This topic provides general information about a chart's series, and their view types available.
A continuity of data points represents a series, which isn't displayed until is has at least one point is specified. For example, the following image demonstrates two separate Line series, and the underlying data they represent.
一些連續性的數據點表示一個序列,要想顯示序列至少需要指定一個點。舉例如下,圖像顯示了兩列獨立的線性序列,表示了隱藏的數據。
Series reside in the ChartControl.Series collection. And, until there is at least one visible series in it, a chart's diagram is empty, as well as the chart itself. To learn the ways in which series can be created are explained, refer to Manually Create a Series.
序列在ChartControl.Series集合中。跟圖表本身一樣,除非至少有一個可見的序列,否則圖表一直為空。
XtraCharts supports numerous different chart types (some of which are shown in the following image), and it's the view type which determines both a series' specific image, and the available set of options. For the list of available series view types, refer to Series Views.
XtraCharts支持很多種不同的圖表類(其中一些如下面所示),它的視圖類型決定了序列的指定圖像和可用的選項設置。關于可用的序列視圖類型,參考Series Views.
The view type of the first visible series in a chart's collection determines the chart's diagram type, meaning that all other series should have a compatible view type, in order for them to be plotted together in the same chart control. For information on series compatibility, refer to Combining Different Series Views.
在圖表集合中,第一個可視化的序列的視圖類型決定了圖表的圖類型,也就是說所有其他序列都應該有一個兼容的視圖類型,這樣才能被繪制在同一個圖表控件中。
The following image demonstrates how a similar set of series views looks in charts with different diagram types (XY-Diagram and XY-Diagram 3D).
下列圖片展示了一組相似序列視圖在不同圖類型(XY-Diagram?and?XY-Diagram 3D)中的外觀。
For more information, refer to Series Views Overview.
| Understanding a Diagram |
This topic provides general information about a chart's diagram, and the types available.
A diagram is a chart's main area, where most of its data and graphical elements are displayed (e.g. series and axes and panes), even although some of these elements doesn't actually belong to a Diagram object (such as Series). For a complete list of chart elements, refer to Chart Elements.
圖是圖表中的主要區域,圖表的大部分數據和圖形元素在上面顯示(比如series?and?axes and panes),雖然有時某些元素并不屬于Diagram對象(比如Series)。完整視圖元素列表,參考Chart Elements.
A single chart control instance can only possess one diagram object. Its particular type is auto-determined by the view type of the first visible series in the chart's collection. Each diagram type has a special set of options, and is used to plot series of a compatible view type only. For a complete list of the available diagram types with each type's description, refer to Diagram.
單一的圖表控件實例只能占據一個圖對象。圖表的特定類型自動由圖表集合的第一個可視序列的視圖類型決定。每一個圖類型有一組特定選項,僅用來繪制相容視圖類型的序列。可用圖類型的類型描述的完整列表,參考Diagram.
At design time, a diagram's options can be accessed via the ChartControl.Diagram property.
在設計時,圖選項可以通過ChartControl.Diagram屬性獲得。
At runtime, to access a diagram's properties, it's required to cast your instance of a Diagram object to a specific type, as the following example demonstrates.
在運行時獲取圖屬性,需要強制圖對象轉換到特定類型,如下例所示。
| ||||||
| using DevExpress.XtraCharts; // ...?private?void Form1_Load(object sender, EventArgs e) {// Create a new ChartControl instance.?ChartControl chartControl1 = new ChartControl();// Access the diagram's properties.?((XYDiagram2D)chartControl1.Diagram).Rotated = true;((XYDiagram2D)chartControl1.Diagram).EnableAxisXScrolling = true; } Imports DevExpress.XtraCharts ' ...?Private?Sub Form1_Load(ByVal sender As?Object, ByVal e As EventArgs) Handles?MyBase.Load' Create a new ChartControl instance.?Dim chartControl1 As?New ChartControl()' Access the diagram's properties.?CType(chartControl1.Diagram, XYDiagram2D).Rotated = True?CType(chartControl1.Diagram, XYDiagram2D).EnableAxisXScrolling = True? End?Sub? |
| C# | using DevExpress.XtraCharts; // ...?private?void Form1_Load(object sender, EventArgs e) {// Create a new ChartControl instance.?ChartControl chartControl1 = new ChartControl();// Access the diagram's properties.?((XYDiagram2D)chartControl1.Diagram).Rotated = true;((XYDiagram2D)chartControl1.Diagram).EnableAxisXScrolling = true; } |
| VB | Imports DevExpress.XtraCharts ' ...?Private?Sub Form1_Load(ByVal sender As?Object, ByVal e As EventArgs) Handles?MyBase.Load' Create a new ChartControl instance.?Dim chartControl1 As?New ChartControl()' Access the diagram's properties.?CType(chartControl1.Diagram, XYDiagram2D).Rotated = True?CType(chartControl1.Diagram, XYDiagram2D).EnableAxisXScrolling = True? End?Sub? |
For most diagram types, you can provide your end-users with the capability to scroll and zoom the diagram. For details on this, refer to Zooming and Scrolling (2D XY-Charts) and Zooming and Scrolling (3D Charts).
對大部分圖類型來說,你可以提供終端的可以滾動和縮放的圖。詳細信息參考Zooming and Scrolling (2D XY-Charts)?and?Zooming and Scrolling (3D Charts).
Among the most common diagram types is the XYDiagram2D, which employs two axes to plot series, and supports multiple panes, in which separate series can be distributed. These are explained in the next topic of this section: Understanding Axes and Panes.
最常見圖類型是XYDiagram2D,使用兩個坐標軸來描繪序列,并支持多面板,可以分布獨立的序列。
For more information on using a diagram, refer to Diagram Overview.
| Understanding Axes and Panes |
This topic provides general information about an XY-diagram's axes and panes, and explains the difference between primary and secondary axes.
介紹XY-diagram的軸和面板,并說明主軸和次軸的區別。
It consists of the following sections:
- Understanding Axes
- Understanding Panes
A diagram's axes are the essential grids of reference for series points, as they provide the coordinates for their arguments and values. Each diagram type represents them differently. Most charts use two axes: the axis of arguments (X-axis) and the axis of values (Y-axis). The following image demonstrates axes of the most popular diagram type (which is the XYDiagram2D).
圖的軸是序列點擊必不可少的參考網格,因為軸為點的參數和值提供了坐標。每一個圖類型以不同的形式展現它們。大部分圖表使用兩個軸:參數軸(X軸)和值軸(Y軸)。
By default, each XY-diagram has only a single pair of the X and Y axis, which are called the primary axis. Additional (or, secondary) axes are supported, which is of great help when, for example, it's required to simultaneously display series with a significant value range difference. For more information, refer to Primary and Secondary Axes.
默認情況下,每一個XY-diagram只有一對X和Y軸,被稱為主軸。也支持額外的軸(次軸),這非常有用,比如要求同時顯示有比較明顯差異范圍的序列時。更多信息,參考Primary and Secondary Axes.
To access the primary axes options at design time, select the chart control, and in the Properties window, expand the ChartControl.Diagram property. You'll see the XYDiagram.AxisX and XYDiagram.AxisY properties, which provide access to the options and elements of the appropriate axis.
設計時獲取主軸選項,需要選擇圖表控件,在屬性窗口中,展開ChartControl.Diagram屬性,將可以看到XYDiagram.AxisX?and?XYDiagram.AxisY屬性,這兩個屬性提供了相應軸的屬性和元素。
To access the primary axes options at runtime, you should cast your Diagram object to the required diagram type, as the following code demonstrates.
運行時獲取主軸的選項,需轉換Diagram對象為要求的圖類型,如下代碼所示。
| ||||||
| ((XYDiagram)chartControl1.Diagram).AxisX.Color = Color.MistyRose; CType(chartControl1.Diagram, XYDiagram).AxisX.Color = Color.MistyRose |
| C# | ((XYDiagram)chartControl1.Diagram).AxisX.Color = Color.MistyRose; |
| VB | CType(chartControl1.Diagram, XYDiagram).AxisX.Color = Color.MistyRose |
Likewise, secondary axes are specified via the XYDiagram.SecondaryAxesX and XYDiagram.SecondaryAxesY properties.
同理,次軸在?XYDiagram.SecondaryAxesX?and?XYDiagram.SecondaryAxesY指定
An important characteristic of an axis is its scale type. It determines how a chart interprets its underlying data: as numeric, date-time or qualitative. Each scale type assumes a specific representation of this data, and the specific options for customizing how this data is represented. An axis scale type is auto-determined by the scale type of series associated with this axis. So, an improper series scale type restricts the available set of axis options, and may cause the chart's data representation to be a completely distorted. For more information, refer to Axis Scale Types.
軸的最重要特性是它的刻度類型。這決定了圖表怎樣解釋背后的數據:作為數值、日期、定性的。每一個刻度類型假定一個特定的數據表示和定制數據如何顯示的特定選項。一個軸的刻度類型由關聯到這個軸的序列的值類型自動指定。所以,不合適的序列標量類型將限制可用的軸選項,甚至導致圖表的數據顯示完全變形。更多信息,參考Axis Scale Types.
The visible range of axis values is auto-determined (while the AxisRange.Auto property is enabled). However, you can manually specify two axis values by which an axis should be limited, either in units appropriate for the axis scale type (via the AxisRange.MinValue and AxisRange.MaxValue properties), or in internal double values with no regard to the axis scale type (AxisRange.MinValueInternal and AxisRange.MaxValueInternal).
軸的可見刻度范圍自動確定(僅當?AxisRange.Auto屬性可用)。然而,你也可以手動指定兩個軸的刻度來限定軸的范圍,或者軸刻度類型合適的單位(AxisRange.MinValue?and?AxisRange.MaxValue屬性)或者內部兩個值,而忽略軸刻度類型(AxisRange.MinValueInternal?and?AxisRange.MaxValueInternal).
In a similar way, when scrolling is enables for both the diagram and the pane to which an axis belong, and the ScrollingRange.Auto property is disabled, you also can manually specify two extreme axis values to which an axis can be scrolled. For more information, refer to Axis Visible and Scrolling Ranges and Zooming and Scrolling (2D XY-Charts).
Along an axis, between pairs of its values, multiple scale breaks can be inserted, to allow compact representation of points with outsized values.
在一對刻度之間,可以插入多個刻度斷點,允許特大值點的緊湊表示。
Axes additional elements are Axis Titles, Axis Labels, Grid Lines, Tickmarks and Interlacing, Constant Lines and Strips.
軸的另外幾個元素是軸標題、軸標簽、網格線、橫線和條帶
To learn more about axes and their functionality, refer to Axes Overview.
Understanding Panes面板A diagrams' pane is a rectangular area used to plot series and their associate axes. In general, panes make it possible to distribute multiple series among different areas, which share (or not) their axes (both primary and secondary). Note that panes are available only for the XYDiagram2D type (which includes the XY-Diagram and Swift Plot Diagram).
圖的面板是一個描繪序列和相關聯坐標軸的矩形區域。面板使得不同區域分布多個序列成為可能,多個序列共用(也可以不共用)坐標軸(主軸和次軸)。注意:面板僅對XYDiagram2D類型有效(包括?XY-Diagram?andSwift Plot Diagram).。
By default, a chart displays its series in the default pane (represented by an XYDiagramDefaultPane object). Its options can be accessed via the XYDiagram2D.DefaultPane property.
默認,圖表數據在XYDiagramDefaultPane對象的默認面板中顯示。可以通過XYDiagram2D.DefaultPane?屬性設置。
To enable additional panes for a diagram, you can add them to the collection returned by the XYDiagram2D.Panes property. For more information, refer to Adding Panes.
要使用其余面板,添加到XYDiagram2D.Panes?序列屬性中,更多信息參考Adding Panes.
When axes scrolling and/or zooming is enabled at the diagram's level (via the XYDiagram2D.EnableAxisXScrolling, XYDiagram2D.EnableAxisYScrolling, XYDiagram2D.EnableAxisXZooming, and XYDiagram2D.EnableAxisYZooming properties), you can adjust the availability of axes scrolling and zooming individually for each pane (via the similar XYDiagramPaneBase.EnableAxisXScrolling, XYDiagramPaneBase.EnableAxisYScrolling, XYDiagramPaneBase.EnableAxisXZooming, and XYDiagramPaneBase.EnableAxisYZooming properties. For more information, refer to Axis Visible and Scrolling Ranges and Zooming and Scrolling (2D XY-Charts).
If panes share the same X or Y axis, by scrolling this axis in one pane, other panes which use the same axis are also scrolled.
To learn more about panes and their functionality, refer to Panes.
總結
以上是生活随笔為你收集整理的Charting Basics制作图表的基本知识的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tradingview教程 charti
- 下一篇: Telerik Silverlight