DundasWebChart5.5.1.1711图表组件使用方法

仅举一例;

首先下载DundasWebChart5.5.1.1711图表组件,有很多破解版,http://dl2.csdn.net/down4/20070923/23185143203.rar 这里面有web和win版本,解压后引用web的组件,然后新建页面,后台代码如下,执行程序会生成一个图表Stat.jpg。

using System;
using System.Drawing;
using System.Web.UI;
using Dundas.Charting.WebControl;

namespace Web
{
    public partial class WebForm1 : Page
    {
        private void Page_Load(object sender, EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
            if (!IsPostBack)
            {
                double industry1 = 19.32;
                double industry2 = 361.38;
                double industry3 = 501.51;
                double industryfull = 1020.05;
                double fixedasserts = 216.13;
                double retailtrade = 32.06;
                double foreigntrade = 443.34;
                double foreigncapital = 3.41;
                //------------------------生产统计图表-------------------------
                Chart Chart1 = new Chart();
                //Chart1.BackImage = Server.MapPath("images/1.gif");
                Chart1.BackGradientEndColor = Color.White;
                Chart1.BorderLineColor = Color.White;
                Chart1.BorderLineWidth = 0;
                Chart1.BorderSkin.FrameBackColor = Color.MediumTurquoise;
                Chart1.BorderSkin.FrameBackGradientEndColor = Color.Teal;
                Chart1.Palette = ChartColorPalette.SemiTransparent;
                Chart1.Width = 545;
                Chart1.Height = 215;
                Chart1.ImageType = ChartImageType.Jpeg;
                Chart1.AntiAliasing = AntiAliasing.All;
                Chart1.Titles.Add("Default");
                Chart1.Titles[0].Text = "2008年12月火星经济指标";
                Chart1.Titles[0].Alignment = ContentAlignment.TopCenter;
                Chart1.Titles[0].Font = new Font("黑体", 12, FontStyle.Bold);
                Chart1.Titles[0].Color = Color.FromArgb(72, 72, 72);
                #region 饼图("一产", "二产", "三产")#region 饼图("一产", "二产", "三产")
                //设置图表区域样式1("一产", "二产", "三产")
                Chart1.ChartAreas.Add("Default");
                ChartArea ChartArea1 = Chart1.ChartAreas["Default"];
                ChartArea1.Area3DStyle.Enable3D = true;
                ChartArea1.Area3DStyle.Light = LightStyle.None;
                ChartArea1.Area3DStyle.XAngle = 70;
                ChartArea1.Area3DStyle.YAngle = 60;
                ChartArea1.BorderWidth = 0;
                ChartArea1.BackColor = Color.Transparent;
                ChartArea1.Position.Auto = false;
                ChartArea1.Position.Width = 50;
                ChartArea1.Position.Height = 30;
                ChartArea1.Position.X = 65;
                ChartArea1.Position.Y = 10;
                //设置图例区域样式1("一产", "二产", "三产")
                Legend Legend1 = Chart1.Legends["Default"];
                Legend1.Alignment = StringAlignment.Center;
                Legend1.BorderWidth = 1;
                Legend1.Font = new Font("幼圆", 8, FontStyle.Bold);
                Legend1.BackColor = Color.Transparent;
                Legend1.FontColor = Color.Black;
                Legend1.DockInsideChartArea = true;
                Legend1.DockToChartArea = "Default";
                //绑定数据1("一产", "二产", "三产")
                double[] yValues = { industry1, industry2, industry3 };
                string[] xValues = { "一产", "二产", "三产" };
                Chart1.Series.Add("Series1");
                Series Series1 = Chart1.Series["Series1"];
                Series1.Points.DataBindXY(xValues, yValues);
                Series1.ChartType = "Pie";
                Series1.BorderColor = Color.White;
                Series1.Palette = ChartColorPalette.EarthTones;
                Series1["LabelStyle"] = "Disabled";
                Series1.ChartArea = "Default";
                Series1.Legend = "Default";
                #endregion

                #region 饼图("投资", "消费", "出口")#region 饼图("投资", "消费", "出口")
                //设置图表区域样式2("投资", "消费", "出口")
                Chart1.ChartAreas.Add("Second");
                ChartArea ChartArea2 = Chart1.ChartAreas["Second"];
                ChartArea2.Area3DStyle.Enable3D = true;
                ChartArea2.Area3DStyle.Light = LightStyle.None;
                ChartArea2.Area3DStyle.XAngle = 70;
                ChartArea2.Area3DStyle.YAngle = 60;
                ChartArea2.BorderWidth = 0;
                ChartArea2.BackColor = Color.Transparent;
                ChartArea2.Position.Auto = false;
                ChartArea2.Position.Width = 50;
                ChartArea2.Position.Height = 30;
                ChartArea2.Position.X = 65;
                ChartArea2.Position.Y = 32;
                //设置图例区域样式2("投资", "消费", "出口")
                Legend Legend2 = new Legend("Second");
                Chart1.Legends.Add(Legend2);
                Legend2.Alignment = StringAlignment.Center;
                Legend2.BorderWidth = 1;
                Legend2.BackColor = Color.Transparent;
                Legend2.Font = new Font("幼圆", 8, FontStyle.Bold);
                Legend2.FontColor = Color.Black;
                Legend2.DockInsideChartArea = true;
                Legend2.DockToChartArea = "Second";
                //绑定数据2("投资", "消费", "出口")
                double[] yValues2 = { fixedasserts, retailtrade, foreigntrade };
                string[] xValues2 = { "投资", "消费", "出口" };
                Chart1.Series.Add("Series2");
                Series Series2 = Chart1.Series["Series2"];
                Series2.Points.DataBindXY(xValues2, yValues2);
                Series2.ChartType = "Pie";
                Series2.BorderColor = Color.White;
                Series2.Palette = ChartColorPalette.Pastel;
                Series2["LabelStyle"] = "Disabled";
                Series2.ChartArea = "Second";
                Series2.Legend = "Second";
                #endregion

                #region              柱状图#region 柱状图
                double[] yTitle3 = { industry1, industry2, industryfull, 0, industry3, fixedasserts, retailtrade, foreigntrade, foreigncapital };
                double x = MaxValue(yTitle3) / 10;
                //设置图表区域样式3
                Chart1.ChartAreas.Add("3nd");
                ChartArea ChartArea3 = Chart1.ChartAreas["3nd"];
                ChartArea3.Area3DStyle.Enable3D = false;
                ChartArea3.Area3DStyle.Light = LightStyle.Realistic;
                ChartArea3.AxisX.LineColor = Color.FromArgb(64, 64, 64);
                ChartArea3.AxisX.LabelStyle.Font = new Font("幼圆", 8, FontStyle.Bold);
                ChartArea3.AxisX.LabelStyle.FontColor = Color.Black;
                ChartArea3.AxisX.LabelStyle.OffsetLabels = false;
                ChartArea3.AxisX.LabelsAutoFit = false;
                ChartArea3.AxisX.MajorGrid.Enabled = false;
                ChartArea3.AxisX.MajorTickMark.Enabled = true;
                ChartArea3.AxisX.MajorTickMark.LineColor = Color.Transparent;
                ChartArea3.AxisX.MajorTickMark.Interval = 4;
                ChartArea3.AxisY.CustomLabels.Add(0, MaxValue(yTitle3) * 2.3, "亿元");
                ChartArea3.AxisY.LabelStyle.Enabled = true;
                ChartArea3.AxisY.LabelStyle.FontAngle = 0;
                ChartArea3.AxisY.LabelStyle.Font = new Font("幼圆", 10, FontStyle.Bold);
                ChartArea3.AxisY.MajorGrid.Enabled = false;
                ChartArea3.AxisY.MajorTickMark.Enabled = false;
                ChartArea3.BorderWidth = 0;
                ChartArea3.BackColor = Color.Transparent;
                ChartArea3.Position.Auto = false;
                ChartArea3.Position.Width = 80;
                ChartArea3.Position.Height = 67;
                ChartArea3.Position.X = 5;
                ChartArea3.Position.Y = 28;
                //设置图例区域样式3
                Legend Legend3 = new Legend("3nd");
                Chart1.Legends.Add(Legend3);
                Legend3.Enabled = false;
                Legend3.DockToChartArea = "3nd";
                //绑定数据3
                double[] yValues3 = { industry1 + x, industry2 + x, industryfull + x, 0, industry3 + x, fixedasserts + x, retailtrade + x, foreigntrade + x, foreigncapital + x };
                string[] xValues3 = { "第一产业", "第二产业", "工业总产值", " ", "第三产业", "固定资产投资", "消费零售总额", "外贸出口", "实际利用外资" };
                Chart1.Series.Add("Series3");
                Series Series3 = Chart1.Series["Series3"];
                Series3.Points.DataBindXY(xValues3, yValues3);
                Series3.ChartType = "Column";
                Series3.BorderColor = Color.White;
                Series3.BackGradientType = GradientType.VerticalCenter;
                Series3.BackGradientEndColor = Color.Khaki;
                Series3.Color = Color.FromArgb(255, 128, 0);
                Series3["PointWidth"] = "0.7";
                Series3.ChartArea = "3nd";
                Series3.Legend = "3nd";
                for (int i = 0; i < Series3.Points.Count; i++)
                {
                    if (yTitle3[i] != 0) Series3.Points[i].Label = yTitle3[i].ToString();
                }
                #endregion

                Chart1.Save(Server.MapPath("Stat.jpg"), ChartImageFormat.Jpeg);

            }
        }

        private static double MaxValue(double[] yValue)
        {
            double maxvalue = 0;
            for (int i = 0; i < yValue.Length; i++)
            {
                if (yValue[i] > maxvalue) maxvalue = yValue[i];
            }
            return maxvalue;
        }
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
在信号处理领域,DOA(Direction of Arrival)估计是一项关键技术,主要用于确定多个信号源到达接收阵列的方向。本文将详细探讨三种ESPRIT(Estimation of Signal Parameters via Rotational Invariance Techniques)算法在DOA估计中的实现,以及它们在MATLAB环境中的具体应用。 ESPRIT算法是由Paul Kailath等人于1986年提出的,其核心思想是利用阵列数据的旋转不变性来估计信号源的角度。这种算法相比传统的 MUSIC(Multiple Signal Classification)算法具有较低的计算复杂度,且无需进行特征值分解,因此在实际应用中颇具优势。 1. 普通ESPRIT算法 普通ESPRIT算法分为两个主要步骤:构造等效旋转不变系统和估计角度。通过空间平移(如延时)构建两个子阵列,使得它们之间的关系具有旋转不变性。然后,通过对子阵列数据进行最小二乘拟合,可以得到信号源的角频率估计,进一步转换为DOA估计。 2. 常规ESPRIT算法实现 在描述中提到的`common_esprit_method1.m`和`common_esprit_method2.m`是两种不同的普通ESPRIT算法实现。它们可能在实现细节上略有差异,比如选择子阵列的方式、参数估计的策略等。MATLAB代码通常会包含预处理步骤(如数据归一化)、子阵列构造、旋转不变性矩阵的建立、最小二乘估计等部分。通过运行这两个文件,可以比较它们在估计精度和计算效率上的异同。 3. TLS_ESPRIT算法 TLS(Total Least Squares)ESPRIT是对普通ESPRIT的优化,它考虑了数据噪声的影响,提高了估计的稳健性。在TLS_ESPRIT算法中,不假设数据噪声是高斯白噪声,而是采用总最小二乘准则来拟合数据。这使得算法在噪声环境下表现更优。`TLS_esprit.m`文件应该包含了TLS_ESPRIT算法的完整实现,包括TLS估计的步骤和旋转不变性矩阵的改进处理。 在实际应用中,选择合适的ESPRIT变体取决于系统条件,例如噪声水平、信号质量以及计算资源。通过MATLAB实现,研究者和工程师可以方便地比较不同算法的效果,并根据需要进行调整和优化。同时,这些代码也为教学和学习DOA估计提供了一个直观的平台,有助于深入理解ESPRIT算法的工作原理。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值