• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

c#devexpresschartcontrol

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

一、Series

Series 作为cartControl的基本单位来现实图表数据

所以每一个Series代表一种需要显示的类型。

首先实例化一个Series

 

Series serie = new Series(Caption, ViewType.Line);  //ViewType是ChartControl图表类型的一个枚举器,其中Bar代表柱状图类型,通过修改ViewType的值可以实现跟换表格类型
series1.ArgumentScaleType = ScaleType.DateTime;//x轴类型
series1.ValueScaleType = ScaleType.Numerical;//y轴类型
series1.ArgumentDataMember = "StatisticsTime";
//X轴的数据字段
series1.ValueDataMembers[0] = "StatisticsSum";//Y轴的数据字段
serie.ValueDataMembersSerializable = "VALUE";
series.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.True;
 LineSeriesView view = (LineSeriesView)serie.View;
series.CrosshairLabelPattern = "{S}:{A}:{V}"; //设置鼠标悬停后提示框显示格式 {S}-名称 {A}-X轴值 {V}-Y轴值
serie.CrosshairTextOptions.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));//设置字体样式
 
view.LineMarkerOptions.Visible = false;//定义线条上点的标识形状是否需要 
view.LineMarkerOptions.Kind = MarkerKind.Circle;  //定义线条上点的标识形状  
((LineSeriesView)series1.View).LineStyle.DashStyle = DashStyle.Solid;//线条的类型,虚线,实线
((PointSeriesLabel)series1.Label).Visible = false; //不显示X、Y轴上面的交点的值     
       

 

 

二、XYDiagram 


 
          
取出xy模式的 diagram , 因为这个sample 是选 xyDiagram 类型
           XYDiagram xyDiagram = (XYDiagram)this.ChartBlance.Diagram;
            xyDiagram.AxisX.AutoScaleBreaks.Enabled = true;
            xyDiagram.AxisX.AutoScaleBreaks.MaxCount = 8;
            xyDiagram.AxisX.DateTimeScaleOptions.AggregateFunction = DevExpress.XtraCharts.AggregateFunction.Custom;//自订格式
            xyDiagram.AxisX.DateTimeScaleOptions.MeasureUnit = DevExpress.XtraCharts.DateTimeMeasureUnit.Minute;//设定时间区间大小
            xyDiagram.AxisX.Interlaced = true;
            xyDiagram.AxisX.Label.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            xyDiagram.AxisX.MinorCount = 5;
            xyDiagram.AxisX.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram.AxisX.VisibleInPanesSerializable = "-1";

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C#生成word文档代码外加IIS报错解决方案发布时间:2022-07-10
下一篇:
C#中运算符的优先级发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap