dundas chart

这个真是一个好东西可惜我不太会总结,摘录一篇,希望有用:

原文地址如下:http://www.cnblogs.com/wrz923/archive/2008/07/05/1236348.html

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dundas.Charting.WebControl;
using System.Drawing;
public partial class TestChart : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        databindXY();
        ControlSet();
        //databindXY();
    }
    private void ControlSet()
    {
        //设置Chart1的相关属性
        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 = "Dundas Chart Demo演示";


        Chart1.Titles[0].Alignment = ContentAlignment.TopCenter;


        Chart1.Titles[0].Font = new Font("黑体", 12, FontStyle.Bold);


        Chart1.Titles[0].Color = Color.FromArgb(72, 72, 72);










        //设置相应Series属性


        Chart1.Series["Default"].Type = SeriesChartType.Line;//设置为折现风格


        Chart1.Series["Default"].BorderColor = Color.White;


        Chart1.Series["Default"].BackGradientType = GradientType.VerticalCenter;


        Chart1.Series["Default"].BackGradientEndColor = Color.Khaki;


        Chart1.Series["Default"].Color = Color.FromArgb(255, 128, 0);//设置折现的颜色


        Chart1.Series["Default"]["PointWidth"] = "0.7";


        Chart1.Series["Default"].BorderStyle = ChartDashStyle.Dash;


        


        for(int i =0;i<Chart1.Series["Default"].Points.Count;i++)


        {


            Chart1.Series["Default"].Points[i].MarkerStyle = MarkerStyle.Diamond;//设置折点的风格


            Chart1.Series["Default"].Points[i].MarkerColor = Color.Red;//设置seires中折点的颜色


        }






        //设置相应的Legend


        Chart1.Legends[0].Enabled = true; //设置Legends的为可见


        Chart1.Legends[0].Alignment = StringAlignment.Near ;//设置在上方


        Chart1.Legends[0].Docking = LegendDocking.Right;//设置Legends的位置在右


        Chart1.Legends[0].AutoFitText = true;//自动适应名称的长度,不然会出现..的情况






        //设置X轴


        Chart1.ChartAreas["Default"].AxisX.Title = "时间";


        Chart1.ChartAreas["Default"].AxisX.TitleAlignment = StringAlignment.Far;//设置X轴标题的名称所在位置位远


        Chart1.ChartAreas["Default"].AxisX.Interval = 1;//设置X轴显示间隔为2 ,对于X轴数据比较多的时候比较有用


        Chart1.ChartAreas["Default"].AxisX.Arrows = ArrowsType.Lines;//设置X轴前面家箭头










        //设置Y轴


        Chart1.ChartAreas["Default"].AxisY.Title = "常量";


        Chart1.ChartAreas["Default"].AxisY.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远


        Chart1.ChartAreas["Default"].AxisY.Arrows = ArrowsType.SharpTriangle;//设置Y轴前面加粗箭头






 










    }










    private void  databindXY()


    {


        string[] xValues = new string[7] { "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" };


        double[] yValues = new double[7] { 50,70,40,30,20,80,10};


        Chart1.Series["Default"].Points.DataBindXY(xValues,yValues);


    }


}



 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Add advanced charting to your ASP.NET applications. Dundas Chart ASP.NET Enterprise Edition is a fully managed, CLR (Common Language Runtime) compliant charting component designed for ASP.NET development. Included is support for all standard and many advanced chart types, drilldown functionality, full Visual Studio Integrated help, a variety of different image formats and intuitive samples and examples to speed up development time. Graphics take full advantage of GDI+ and the use of transparency, anti-aliasing, gradients and more. Dundas Chart for ASP.NET Enterprise Edition includes many advanced features including: formula support, data grouping, data filtering and advanced chart types. Dundas Chart for .NET is the industry leader in .NET Charting Solutions. Providing you with the most comprehensive features, the most complete sample framework, and the best live technical support available. From start to finish, our team is dedicated to providing what you need to make your project successful. Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced, award-winning technology and advanced results to get the most out of data What’s new in Dundas Chart for ASP.NET? Now supports Visual Studio 2010 What’s new in Dundas Chart V7.1? - V7.1 fixes these issues: AlwaysRecreateHotregions="True" in WinForms templates or templates generated by Chart Builder causes the Exception Can't deserialize property. Unknown property name "AlwaysRecreateHotregions" in object Dundas.Charting.WebControl.Chart" when de-serialized in ASP.NET Chart. This property only exists in the WinForms Chart. The ASP.NET Chart ignores this property by default now. Chart .NET: Stacked Column + 3D throws an Index was out of range exception when series have a different number of data points The accumulation distribution formula is incorrect; if open and close are the same it will divide by zero. A friendlier exception message is th
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值