dundas图例

图片。

 

 

private void Page_Load(object sender, System.EventArgs e)
        
{
            
// 在此处放置用户代码以初始化页面
            if(!this.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;
                
//------------------------生产统计图表-------------------------
                Dundas.Charting.WebControl.Chart Chart1 = new Dundas.Charting.WebControl.Chart();
                Chart1.BackImage 
= this.Server.MapPath("cn/images/target/back_img.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(727272);
                
#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

                
饼图("投资", "消费", "出口")
                
柱状图
                Chart1.Save(
this.Server.MapPath("Stat.jpg"), ChartImageFormat.Jpeg);

            }

        }


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

            
return maxvalue;
        }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值