简要说明
百分比堆积样条面积图 (100% 堆积样条面积图) 是由 FullStackedSplineArea3DSeriesView 对象来表示的,此对象属于 面积系列视图。 这种视图类似于 百分比堆积面积图,但是绘制一条适当的穿过系列中每个数据点的曲线。
在下面的插图中显示了一个百分比堆积样条面积图。
注意 |
---|
百分比堆积样条面积图可以显示包含正值或负值数据点的系列。 但是,有正值的系列只能与其他包含正值的系列相堆积; 有负值的系列与其他包含负值的系列相堆积。 注意,如果系列同时包含正值和负值数据点,那么它被作为有正值的系列进行处理,而它的所有负值都被视为零。 |
图表类型特征
下表列出了这种图表类型的主要特征。
特征 |
取值 |
---|---|
系列视图类型 | FullStackedSplineArea3DSeriesView |
图象类型 | XYDiagram3D |
每个数据点的参数个数 | 1 |
每个数据点的取值个数 | 1 |
注意 |
---|
要获得关于哪些图表类型可以与 百分比堆积样条面积图 组合使用的信息,请参阅 组合使用不同的系列视图 文档。 |
示例
下面的示例演示了在运行时刻如何创建 ChartControl (拥有两个 FullStackedSplineArea3DSeriesView 类型的系列),设置它的常规属性,并把图表添加到窗体中。 在继续本示例之前,首先要在 Visual Studio 中创建一个 Windows 窗体应用程序,并把所有 必需的程序集 包含到项目的“引用”列表中。
然后,把下列代码添加到 Form.Load 事件处理程序。
C# | 复制代码 |
---|---|
using System; using System.Windows.Forms; using DevExpress.XtraCharts; // ... private void Form1_Load(object sender, EventArgs e) { // Create an empty chart. ChartControl fullStackedSplineArea3DChart = new ChartControl(); // Create two series of the FullStackedSplineArea3D view type. Series series1 = new Series("Series 1", ViewType.FullStackedSplineArea3D); Series series2 = new Series("Series 2", ViewType.FullStackedSplineArea3D); // Populate both series with points. series1.Points.Add(new SeriesPoint("A", 80)); series1.Points.Add(new SeriesPoint("B", 20)); series1.Points.Add(new SeriesPoint("C", 50)); series1.Points.Add(new SeriesPoint("D", 30)); series2.Points.Add(new SeriesPoint("A", 40)); series2.Points.Add(new SeriesPoint("B", 60)); series2.Points.Add(new SeriesPoint("C", 20)); series2.Points.Add(new SeriesPoint("D", 80)); // Add the series to the chart. fullStackedSplineArea3DChart.Series.AddRange(new Series[] { series1, series2}); // Adjust the series options. series1.Label.Visible = false; series2.Label.Visible = false; // Adjust the view-type-specific options of the series. ((FullStackedSplineArea3DSeriesView)series1.View).Transparency = 20; ((FullStackedSplineArea3DSeriesView)series2.View).Transparency = 60; // Access the diagram's options. ((XYDiagram3D)fullStackedSplineArea3DChart.Diagram).ZoomPercent = 110; // Add a title to the chart and hide the legend. ChartTitle chartTitle1 = new ChartTitle(); chartTitle1.Text = "3D Full Stacked Spline Area Chart"; fullStackedSplineArea3DChart.Titles.Add(chartTitle1); fullStackedSplineArea3DChart.Legend.Visible = false; // Add the chart to the form. fullStackedSplineArea3DChart.Dock = DockStyle.Fill; this.Controls.Add(fullStackedSplineArea3DChart); } |
Visual Basic | 复制代码 |
---|---|
Imports System Imports System.Windows.Forms Imports DevExpress.XtraCharts ' ... Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load ' Create an empty chart. Dim fullStackedSplineArea3DChart As New ChartControl() ' Create two series of the FullStackedSplineArea3D view type. Dim series1 As New Series("Series 1", ViewType.FullStackedSplineArea3D) Dim series2 As New Series("Series 2", ViewType.FullStackedSplineArea3D) ' Populate both series with points. series1.Points.Add(New SeriesPoint("A", 80)) series1.Points.Add(New SeriesPoint("B", 20)) series1.Points.Add(New SeriesPoint("C", 50)) series1.Points.Add(New SeriesPoint("D", 30)) series2.Points.Add(New SeriesPoint("A", 40)) series2.Points.Add(New SeriesPoint("B", 60)) series2.Points.Add(New SeriesPoint("C", 20)) series2.Points.Add(New SeriesPoint("D", 80)) ' Add the series to the chart. fullStackedSplineArea3DChart.Series.AddRange(New Series() { series1, series2}) ' Adjust the series options. series1.Label.Visible = False series2.Label.Visible = False ' Adjust the view-type-specific options of the series. CType(series1.View, FullStackedSplineArea3DSeriesView).Transparency = 20 CType(series2.View, FullStackedSplineArea3DSeriesView).Transparency = 60 ' Access the diagram's options. CType(fullStackedSplineArea3DChart.Diagram, XYDiagram3D).ZoomPercent = 110 ' Add a title to the chart and hide the legend. Dim chartTitle1 As New ChartTitle() chartTitle1.Text = "3D Full Stacked Spline Area Chart" fullStackedSplineArea3DChart.Titles.Add(chartTitle1) fullStackedSplineArea3DChart.Legend.Visible = False ' Add the chart to the form. fullStackedSplineArea3DChart.Dock = DockStyle.Fill Me.Controls.Add(fullStackedSplineArea3DChart) End Sub |
Show Me |
---|
在 DevExpress Code Central 数据库中可以找到完整的示例项目,网址是 http://www.devexpress.com/example=E1024。 取决于目标平台类型 (ASP.NET、WinForms 等),可以在线运行本示例,或者下载自动可执行的示例。 |