zoukankan      html  css  js  c++  java
  • MSChart<2> 柱状图绘制及其样式

    微软Chart控件的安装及其使用,参考:微软图表控件MsChart使用初探,这篇文章写得相当详细,入门使用全是她的功劳~

    以下,是分享的一个柱状图的好看的样式, 先预览一下:

    HTML
     1 <asp:Chart ID="Chart2" runat="server" BorderlineDashStyle="Solid" BorderlineColor="Gray" Width="768px" BackGradientStyle="DiagonalLeft" BackSecondaryColor="AliceBlue"
    2 BackColor="WhiteSmoke">
    3 <Legends>
    4 <asp:Legend Name="ExpLgd" BackColor="Transparent" Docking="Top"></asp:Legend>
    5 </Legends>
    6 <Series>
    7 <asp:Series Name="Series1" IsValueShownAsLabel="true" Color="#0066FF" CustomProperties="DrawingStyle=Cylinder, MinPixelPointWidth=20, MaxPixelPointWidth=35, PointWidth=0.3"
    8 IsXValueIndexed="False" ShadowOffset="1" Legend="ExpLgd" ChartArea="ChartArea1">
    9 </asp:Series>
    10 </Series>
    11 <ChartAreas>
    12 <asp:ChartArea Name="ChartArea1" BackColor="WhiteSmoke" BackSecondaryColor="Silver"
    13 BackGradientStyle="DiagonalLeft" ShadowOffset="2">
    14 <AxisY>
    15 <MajorGrid LineColor="LightSlateGray" LineDashStyle="Dash" />
    16 </AxisY>
    17 <AxisX>
    18 <MajorGrid Enabled="False" />
    19 <LabelStyle Font="Microsoft Sans Serif, 8pt" />
    20 </AxisX>
    21 </asp:ChartArea>
    22 </ChartAreas>
    23 </asp:Chart>

    后台代码: 绑定Chart

     1 private void BindScoreTrend()
    2 {
    3 Report1BLL reportBLL = new Report1BLL();
    4 DataTable dt = null;
    5 dt = reportBLL.GetScoreTrend(testID);
    6
    7 Chart2.Series["Series1"].Points.DataBind(dt.DefaultView, "SWVersion", "TotalScore", "LegendText=SWVersion,YValues=TotalScore,ToolTip=TotalScore");
    8 Chart2.Series["Series1"].ChartType = SeriesChartType.Column;
    9 Chart2.Series["Series1"].Name = " Total Score"; //ddlActivity.SelectedItem.Text;
    10 Chart2.DataBind();
    11 }


    另外还有线性图,饼状图,和雷达图,都是最初步的应用,一次项目的总结。如果你也遇到这个问题,请参考。

    大牛们,如果你们看到有什么错误,还望不吝赐教。

    谢谢~

    Be the change you want to see in the world.
  • 相关阅读:
    "gcc: cannot specify -o when generating multiple output files"解决方案
    VSCode 回退到上一层
    Mac下的clion配置c/c++环境
    安装homebrew报错error: Not a valid ref: refs/remotes/origin/master 的解决方法
    正则多个空格替换成一个空格 多个相同的字符值保留一个
    python for 循环的速度
    下载器
    requests content 和text 编码格式
    博客园积分排名
    python QQ 发送邮件功能
  • 原文地址:https://www.cnblogs.com/eva_2010/p/2284907.html
Copyright © 2011-2022 走看看