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();



转载于:https://www.cnblogs.com/eva_2010/archive/2011/12/12/2284987.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值