mschart 饼图

大家对照线线的样式

前台

<asp:Chart ID="Chart6" BorderlineColor="Green" BorderlineDashStyle="Solid" BorderSkin-BorderColor="Red" BackGradientStyle="TopBottom" BorderlineWidth="1"
        runat="server" Palette="None"
        PaletteCustomColors="192, 192, 255; Silver"  Height="270px">
       <legends>
        <asp:Legend BorderColor="yellow" BorderDashStyle="Solid" BorderWidth="2"    Docking="Bottom" TitleAlignment="Near" Alignment="Center"  TitleFont="Trebuchet MS, 14pt"  Font="Trebuchet MS, 14pt" Name="Default" LegendStyle="Column"></asp:Legend>
       </legends>
       <Series>
            <asp:Series Name="Default" BorderColor="blue"  BorderWidth="1"  ChartType="Pie" BackHatchStyle="Percent20">
            </asp:Series>
        </Series>
  <ChartAreas>
            <asp:ChartArea   BorderDashStyle="Solid" Name="ChartArea1" BorderColor="black"  BorderWidth="2">
            </asp:ChartArea>
        </ChartAreas>
        <BorderSkin  BorderColor="red" BorderDashStyle="Solid" BorderWidth="2" />
    </asp:Chart>

后台

//百分号显示 

Chart6.Series["Default"].Label = "#PERCENT{P}";
            Chart6.Legends["Default"].Title = "工程总造价:  " + "456";
            double[] yValues1 = { 40, 50 };
            string[] xValues1 = { "已完成", "未完成" };
            Chart6.Series["Default"].Points.DataBindXY(xValues1, yValues1);
            foreach (DataPoint point in Chart6.Series["Default"].Points)
            {
                point.LegendText =point.AxisLabel+"   "+Chart6.Series["Default"].Label ;
            }

 //柱图绑定

//数据的绑定还有这个
            Chart2.DataSource = ds.Tables[0];
            Chart2.Series[Finished].YValueMembers = "TotalMoney";//绑定的列名
            Chart2.Series[Unfinished].XValueMember = "score";

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值