简要说明
漏斗图 是由 Funnel3DSeriesView 对象来表示的,此对象属于 饼、圆环和漏斗系列视图。 典型地,漏斗图在上部显示一个宽区域,以指明点取值的总计,而其他区域则按比例逐个变小。
漏斗图经常被用于呈现销售过程的各个阶段,并显示每个阶段潜在收入的总计。 这种类型的图表也可以被用于识别团队的销售过程中潜在的问题区。
漏斗图显示一个从 100% 开始、并结束于较低百分比的过程,展示重大变更发生 (例如“瓶颈”) 的地方及其比例。 如果漏斗图还兼有调查数据,意思是在每个销售或订单执行过程的步骤中正好有多少项失误的定量计量,那么漏斗图就说明该过程中最大的瓶颈在哪里。
通常,漏斗图把取值显示为逐步递减的比例,在漏斗系列点的上部宽度中表示这些比例。 因此,在集合中有最大值的数据点被视为 100%,并且被呈现为在漏斗顶部生成的最宽的多边形。 取值中后续系列点被呈现为后续的多边形,其上部宽度表示该点取值相对于前一点取值的比例,等等,直到最后一点 (下部宽度等于上部宽度)。
漏斗图可以被用于显示网站访客动向,如下面的插图所示的那样。
图表类型特征
下表列出了这种图表类型的主要特征。
特征 |
取值 |
---|---|
系列视图类型 | Funnel3DSeriesView |
图象类型 | FunnelDiagram3D |
每个数据点的参数个数 | 1 |
每个数据点的取值个数 | 1 |
示例
下面的示例演示了在运行时刻如何创建 ChartControl (拥有一个 Funnel3DSeriesView 类型的系列),并把图表添加到窗体中。 在继续本示例之前,首先要在 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 funnelChart3D = new ChartControl(); // Create a funnel series. Series series1 = new Series("Funnel Series 1", ViewType.Funnel3D); // Populate the series with points. series1.Points.Add(new SeriesPoint("A", 28.5)); series1.Points.Add(new SeriesPoint("B", 19.6)); series1.Points.Add(new SeriesPoint("C", 17.1)); series1.Points.Add(new SeriesPoint("D", 12.5)); series1.Points.Add(new SeriesPoint("E", 9.6)); // Add the series to the chart. funnelChart3D.Series.Add(series1); // Display a title for the series, // and adjust another view-type-specific options of the series. Funnel3DSeriesView funnelView = (Funnel3DSeriesView)series1.View; funnelView.Titles.Add(new SeriesTitle()); funnelView.Titles[0].Text = series1.Name; funnelView.HeightToWidthRatio = 1; funnelView.HoleRadiusPercent = 70; funnelView.PointDistance = 5; // Adjust the value numeric options of the series. series1.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent; series1.PointOptions.ValueNumericOptions.Precision = 1; // Access the view-type-specific series options. ((FunnelPointOptions)series1.PointOptions).PercentOptions.ValueAsPercent = true; // Position the series labels. ((Funnel3DSeriesLabel)series1.Label).Position = FunnelSeriesLabelPosition.LeftColumn; // Access the diagram's options. ((FunnelDiagram3D)funnelChart3D.Diagram).RuntimeRotation = true; ((FunnelDiagram3D)funnelChart3D.Diagram).RotationType = RotationType.UseMouseStandard; // Hide the chart's legend. funnelChart3D.Legend.Visible = false; // Add the chart to the form. funnelChart3D.Dock = DockStyle.Fill; this.Controls.Add(funnelChart3D); } |
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 funnelChart3D As New ChartControl() ' Create a funnel series. Dim series1 As New Series("Funnel Series 1", ViewType.Funnel3D) ' Populate the series with points. series1.Points.Add(New SeriesPoint("A", 28.5)) series1.Points.Add(New SeriesPoint("B", 19.6)) series1.Points.Add(New SeriesPoint("C", 17.1)) series1.Points.Add(New SeriesPoint("D", 12.5)) series1.Points.Add(New SeriesPoint("E", 9.6)) ' Add the series to the chart. funnelChart3D.Series.Add(series1) ' Display a title for the series, ' and adjust another view-type-specific options of the series. Dim funnelView As Funnel3DSeriesView = CType(series1.View, Funnel3DSeriesView) funnelView.Titles.Add(New SeriesTitle()) funnelView.Titles(0).Text = series1.Name funnelView.HeightToWidthRatio = 1 funnelView.HoleRadiusPercent = 70 funnelView.PointDistance = 5 ' Adjust the value numeric options of the series. series1.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent series1.PointOptions.ValueNumericOptions.Precision = 1 ' Access the view-type-specific series options. CType(series1.PointOptions, FunnelPointOptions).PercentOptions.ValueAsPercent = True ' Position the series labels. CType(series1.Label, Funnel3DSeriesLabel).Position = _ FunnelSeriesLabelPosition.LeftColumn ' Access the diagram's options. CType(funnelChart3D.Diagram, FunnelDiagram3D).RuntimeRotation = True CType(funnelChart3D.Diagram, FunnelDiagram3D).RotationType = _ RotationType.UseMouseStandard ' Hide the chart's legend. funnelChart3D.Legend.Visible = False ' Add the chart to the form. funnelChart3D.Dock = DockStyle.Fill Me.Controls.Add(funnelChart3D) End Sub |
Show Me |
---|
在 DevExpress Code Central 数据库中可以找到完整的示例项目,网址是 http://www.devexpress.com/example=E1552。 取决于目标平台类型 (ASP.NET、WinForms 等),可以在线运行本示例,或者下载自动可执行的示例。 |