简要说明
百分比堆积样条面积图 (100% 堆积样条面积图) 是由 FullStackedSplineAreaSeriesView 对象来表示的,此对象属于 面积系列视图。 这种视图类似于 百分比堆积面积图,但是绘制一条适当的穿过系列中每个数据点的曲线。
在下面的插图中显示了一个百分比堆积样条面积图。 注意,这种图表类型基于 XYDiagram,因此可以被旋转,从而垂直地或水平地显示图表。
注意 |
---|
百分比堆积样条面积图可以显示包含正值或负值数据点的系列。 但是,有正值的系列只能与其他包含正值的系列相堆积; 有负值的系列与其他包含负值的系列相堆积。 注意,如果系列同时包含正值和负值数据点,那么它被作为有正值的系列进行处理,而它的所有负值都被视为零。 |
图表类型特征
下表列出了这种图表类型的主要特征。
特征 |
取值 |
---|---|
系列视图类型 | FullStackedSplineAreaSeriesView |
图象类型 | 2D- XYDiagram |
每个数据点的参数个数 | 1 |
每个数据点的取值个数 | 1 |
注意 |
---|
要获得关于哪些图表类型可以与 百分比堆积样条面积图 组合使用的信息,请参阅 组合使用不同的系列视图 文档。 |
示例
下面的示例演示了在运行时刻如何创建 ChartControl (拥有一个 FullStackedSplineAreaSeriesView 类型的系列),设置它的常规属性,并把图表添加到窗体中。 在继续本示例之前,首先要在 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 fullStackedSplineAreaChart = new ChartControl(); // Create two series of the FullStackedSplineArea view type. Series series1 = new Series("Series 1", ViewType.FullStackedSplineArea); Series series2 = new Series("Series 2", ViewType.FullStackedSplineArea); // 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. fullStackedSplineAreaChart.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. ((FullStackedSplineAreaSeriesView)series1.View).LineTensionPercent = 80; ((FullStackedSplineAreaSeriesView)series2.View).Transparency = 80; // Access the diagram's options. ((XYDiagram)fullStackedSplineAreaChart.Diagram).Rotated = true; // Add a title to the chart and hide the legend. ChartTitle chartTitle1 = new ChartTitle(); chartTitle1.Text = "Full Stacked Spline Area Chart"; fullStackedSplineAreaChart.Titles.Add(chartTitle1); fullStackedSplineAreaChart.Legend.Visible = false; // Add the chart to the form. fullStackedSplineAreaChart.Dock = DockStyle.Fill; this.Controls.Add(fullStackedSplineAreaChart); } |
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 fullStackedSplineAreaChart As New ChartControl() ' Create two series of the FullStackedSplineArea view type. Dim series1 As New Series("Series 1", ViewType.FullStackedSplineArea) Dim series2 As New Series("Series 2", ViewType.FullStackedSplineArea) ' 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. fullStackedSplineAreaChart.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, FullStackedSplineAreaSeriesView).LineTensionPercent = 80 CType(series2.View, FullStackedSplineAreaSeriesView).Transparency = 80 ' Access the diagram's options. CType(fullStackedSplineAreaChart.Diagram, XYDiagram).Rotated = True ' Add a title to the chart and hide the legend. Dim chartTitle1 As New ChartTitle() chartTitle1.Text = "Full Stacked Spline Area Chart" fullStackedSplineAreaChart.Titles.Add(chartTitle1) fullStackedSplineAreaChart.Legend.Visible = False ' Add the chart to the form. fullStackedSplineAreaChart.Dock = DockStyle.Fill Me.Controls.Add(fullStackedSplineAreaChart) End Sub |
Show Me |
---|
在 DevExpress Code Central 数据库中可以找到完整的示例项目,网址是 http://www.devexpress.com/example=E1052。 取决于目标平台类型 (ASP.NET、WinForms 等),可以在线运行本示例,或者下载自动可执行的示例。 |