zoukankan      html  css  js  c++  java
  • MsChart<1> 线性图

    线性图,ChartType=“Line”是折线,ChartType="Spline"是平滑曲线

    HTML教程
     1 <asp:Chart ID="Chart1" runat="server" Width="930px" Height="500" BackColor="Azure" BackSecondaryColor="White" BackGradientStyle="TopBottom">
    2 <Legends>
    3 <%-- <asp:Legend Alignment="Center" Docking="Right" Name="Legend1" Title="Test Value">
    4 </asp:Legend>--%>
    5 </Legends>
    6 <Titles>
    7 <asp:Title Font="微软雅黑, 16pt" Name="Title1" Text="">
    8 </asp:Title>
    9 </Titles>
    10 <Series>
    11 <asp:Series Name="Software" IsValueShownAsLabel="true" ChartType="Spline" XValueType="String" YValueMembers="TestValue" BorderColor="AliceBlue" BorderWidth="2">
    12 </asp:Series>
    13 </Series>
    14 <ChartAreas>
    15 <asp:ChartArea Name="ChartArea1" BackColor="Azure" BackSecondaryColor="White" BackGradientStyle="TopBottom">
    16 <AxisX LineColor="Blue" LineWidth="2" TitleForeColor="Red" TextOrientation="Horizontal" ToolTip="Software">
    17 <MinorGrid Interval="1" LineColor="Blue" />
    18 </AxisX>
    19 <AxisY LineColor="Blue" LineWidth="2" Title="TestValue(Unit:mAh)" TitleForeColor="Red" TitleAlignment="Far">
    20 <MinorGrid Interval="1" LineColor="Blue" />
    21 </AxisY>
    22 </asp:ChartArea>
    23 </ChartAreas>
    24 </asp:Chart>

    后台:

    View Code
     1 Chart1.Titles["Title1"].Text = ddlCase.SelectedItem.Text;//整个图表的标题
    2 Chart1.Series["Software"].ChartType = SeriesChartType.Spline;
    3 Chart1.Series["Software"].Points.DataBind(dtLine.DefaultView, "Show", "TestValue", "");
    4
    5 //设置Chart的外观
    6 Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1.0;
    7 Chart1.ChartAreas["ChartArea1"].AxisX.IntervalOffset = 1;
    8 Chart1.ChartAreas["ChartArea1"].AxisX.IsLabelAutoFit = true;
    9 Chart1.ChartAreas["ChartArea1"].AxisX.LineColor = Color.Blue;
    10 Chart1.ChartAreas["ChartArea1"].AxisX.TextOrientation = TextOrientation.Rotated270;
    11 Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineColor = Color.Wheat;
    12 Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineColor = Color.Gray;
    13 Chart1.DataBind();



    Be the change you want to see in the world.
  • 相关阅读:
    Spark_3:Spark集群搭建
    Spark_2:Spark 快速入门教程
    Spark快速大数据分析_11:第十一章
    Spark快速大数据分析_10:第十章
    Spark快速大数据分析_9:第九章
    Spark快速大数据分析_8:第八章
    Spark快速大数据分析_7:第七章
    Spark快速大数据分析_6:第六章
    Spark快速大数据分析_5:第五章
    java 内部类详解
  • 原文地址:https://www.cnblogs.com/eva_2010/p/2284987.html
Copyright © 2011-2022 走看看