[Infragistics]利用第三方控件实现仪盘表效果

原创 2012年03月26日 11:16:54

最近在做ERP数据分析的时候,看到网友法者:利用用友自带的BI的工具做出仪盘表的效果:

那如果我也想做呢?查询了网上很做资料都没有结果。很多都要收费和破解

这个时候想到了用Infragistics第三方控件自己有一个基于WEB2.0的破解版控件,那就先试试吧。

首先引用DLL

Infragistics2.WebUI.Shared.v7.3.dll

Infragistics2.WebUI.UltraWebGauge.v7.3.dll

类库:using Infragistics.UltraGauge.Resources;

参考官方网站:http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/WebGauge_Web_Creating_a_Radial_WebGauge_Using_Code.html

 private void Gauge2() 
    {
     // Infragistics.WebUI.UltraWebGauge.UltraGauge ultraGauge2 =
     //new Infragistics.WebUI.UltraWebGauge.UltraGauge();
         
        RadialGauge myRadialGauge = new RadialGauge();
        RadialGaugeScale myScale = new RadialGaugeScale();
        NumericAxis numericAxis1 = new NumericAxis();
        RadialGaugeNeedle myNeedle = new RadialGaugeNeedle();
        SolidFillBrushElement mySolidFillBrushElement = new SolidFillBrushElement();
        SolidFillBrushElement mySolidFillBrushElementMajor =
          new SolidFillBrushElement();
        SolidFillBrushElement mySolidFillBrushElementMinor =
          new SolidFillBrushElement();
        SolidFillBrushElement mySolidFillBrushElementMinorStroke =
          new SolidFillBrushElement();
        StrokeElement myStrokeElement = new StrokeElement();
        SolidFillBrushElement mySolidFillBrushElement2 = new SolidFillBrushElement();
        SimpleGradientBrushElement mySimpleGradientBrushElement =
          new SimpleGradientBrushElement();
        SolidFillBrushElement mySolidFillBrushElement1 = new SolidFillBrushElement();
        mySolidFillBrushElement.Color = System.Drawing.Color.Black;
        myRadialGauge.Dial.BrushElement = mySolidFillBrushElement;
        myRadialGauge.Margin = new Margin(10, 10, 10, 10, Measure.Pixels);
        //Set the following Axis properties and add the Axis to your scale: 
        numericAxis1.EndValue = 120; //仪盘表最大数值
        myScale.Axes.Add(numericAxis1);
        //Set the following Scale properties
        myScale.EndAngle = 405; 
        myScale.StartAngle = 135;
       
        mySolidFillBrushElement1.Color = System.Drawing.Color.White;
        myScale.Labels.BrushElement = mySolidFillBrushElement1;

        //Set the following Label properties
        myScale.Labels.Extent = 65;
        myScale.Labels.Font =
          new System.Drawing.Font("Arial", 14F,
          System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
        myScale.Labels.Frequency = 20;//大间隔显示数值:0 20 40 60 
        myScale.Labels.Orientation =
          Infragistics.UltraGauge.Resources.RadialLabelOrientation.Horizontal;
        myScale.Labels.SpanMaximum = 18;

        //Set the following major Tickmark properties: 
        mySolidFillBrushElementMajor.Color =
  System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(189)))),
  ((int)(((byte)(189)))));
        myScale.MajorTickmarks.BrushElement = mySolidFillBrushElementMajor;
        myScale.MajorTickmarks.EndExtent = 95; 
        myScale.MajorTickmarks.EndWidth = 3;
        myScale.MajorTickmarks.Frequency = 10; //大间隔显示频率
        myScale.MajorTickmarks.StartExtent = 85;
        myScale.MajorTickmarks.StartWidth = 3;

        //Set the following minor Tickmark properties: 
        mySolidFillBrushElementMinor.Color =
  System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))),
  ((int)(((byte)(240)))));
        myScale.MinorTickmarks.BrushElement = mySolidFillBrushElementMinor;
        myScale.MinorTickmarks.EndExtent = 90; 
        myScale.MinorTickmarks.EndWidth = 1;
        myScale.MinorTickmarks.Frequency = 2;
        //小间隔频率=myScale.MajorTickmarks.Frequency/myScale.MinorTickmarks.Frequency=10/2=5
        myScale.MinorTickmarks.StartExtent = 85;
        mySolidFillBrushElementMinorStroke.Color =
          System.Drawing.Color.FromArgb(((int)(((byte)(135)))), ((int)(((byte)(135)))),
          ((int)(((byte)(135)))));
        myStrokeElement.BrushElement = mySolidFillBrushElementMinorStroke;
        myScale.MinorTickmarks.StrokeElement = myStrokeElement;

        //Set the following Anchor properties: 
        myNeedle.Anchor.BrushElement = mySimpleGradientBrushElement;
        mySimpleGradientBrushElement.EndColor = System.Drawing.Color.WhiteSmoke;
        mySimpleGradientBrushElement.GradientStyle =
          Infragistics.UltraGauge.Resources.Gradient.BackwardDiagonal;
        mySimpleGradientBrushElement.StartColor = System.Drawing.Color.Gray;
        myNeedle.Anchor.RadiusMeasure =
          Infragistics.UltraGauge.Resources.Measure.Percent;

        //设置指针属性
        mySolidFillBrushElement2.Color = System.Drawing.Color.Red;
        myNeedle.BrushElement = mySolidFillBrushElement2;
        myNeedle.EndExtent = 65;
        myNeedle.EndWidth = 1;
        myNeedle.MidExtent = 0;
        myNeedle.MidWidth = 3;
        myNeedle.Precision = 1;
        myNeedle.StartExtent = -20;
        myNeedle.StartWidth = 3;
        myNeedle.Value = int.Parse(TextBox2.Text.Trim());//指针显示值
        myNeedle.WidthMeasure = Measure.Percent;
        myScale.Markers.Add(myNeedle);

        
        myRadialGauge.Scales.Add(myScale);
        UltraGauge2.Gauges.Add(myRadialGauge);
        //图形的大小
        UltraGauge2.Height = Unit.Pixel(200); 
        UltraGauge2.Width = Unit.Pixel(200);

        //显示文本框
        BoxAnnotation boxAnnotation1 = new BoxAnnotation();
        SolidFillBrushElement solidFillBrushElement1 = new SolidFillBrushElement();
        SolidFillBrushElement solidFillBrushElement2 = new SolidFillBrushElement();
        boxAnnotation1.Bounds = new System.Drawing.Rectangle(38, 70, 25, 10);
        boxAnnotation1.BoundsMeasure = Infragistics.UltraGauge.Resources.Measure.Percent;
        solidFillBrushElement2.Color = System.Drawing.Color.White;
        boxAnnotation1.Label.BrushElement = solidFillBrushElement2;
        boxAnnotation1.Label.FormatString = "Speed";
        this.UltraGauge2.Annotations.Add(boxAnnotation1);


        this.Controls.Add(UltraGauge2);

    }


我在前台拉了一个控件主要是为了定位位置。

<%@ Register Assembly="Infragistics2.WebUI.UltraWebGauge.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.UltraWebGauge" TagPrefix="igGauge" %>
<%@ Register Assembly="Infragistics2.WebUI.UltraWebGauge.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.UltraGauge.Resources" TagPrefix="igGaugeProp" %>

        <igGauge:UltraGauge ID="UltraGauge2" runat="server"  >
        </igGauge:UltraGauge>

看看效果是否达到了呢?


界面单调,具体功能还没有深入研究,如果你知道具体的使用方法请与我联系。

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

iOS开发不借助第三方控件实现侧边栏效果

最近在研究iOS程序的侧边栏,因为发现渐渐的iOS的程序也开始走侧边栏的风格了,QQ,今日头条,Path(Path算最早出现侧边栏的app了,所以也把侧边栏效果说成是Path效果),所以就研究了下。 ...

实现类似google搜索效果,文本框输入智能提示,没有用ajax控件和第三方控件,完全手写代码

前台页面代码:<html xm
  • wdywqc
  • wdywqc
  • 2011-04-12 10:18
  • 1917

常用第三方控件的利用

  • 2010-06-04 09:20
  • 3.03MB
  • 下载

第三方控件Banner实现轮播(活数据和死数据)

1.第一步,添加依赖: compile 'com.youth.banner:banner:1.4.9' compile 'com.github.bumptech.glide:glide:4...

给DataList分页有两个办法:1、自定义实现分页方法 2、用第三方控件(例如AspNetPager)

给DataList分页有两个办法:1、自定义实现分页方法 2、用第三方控件(例如AspNetPager) 先介绍下如何自定义实现分页方法。 我的DataList分页方法的核心原理是利用Pa...

Fragment+viewpagerIndicator第三方控件实现APP主界面

Fragment+viewpagerIndicator实现APP主界面是现在是各种新闻客户端等APP开发最常用的。 通过第三方控件 viewpagerIndicator 来管理主界面的TAB 的...

Android使用第三方控件实现侧滑删除

简单介绍下本次使用的第三方控件–SwipeRecyclerView。 (https://github.com/yanzhenjie/SwipeRecyclerView)首先肯定是我们的依赖啦~com...

net第三方控件列表

网页设计中针对中文排版CSS心得asp.net 2.0服务器控件开发之控件样式字号: 大大  中中  小小.net组件和控件DevExpress DotNetBar V4.7DevExpress Do...

asp.net 第三方控件列表

asp.net 第三方控件列表
  • PuCan
  • PuCan
  • 2011-03-28 11:12
  • 324
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)