asp.net制作简单的曲线图

首先下载DundasWebChart.dll 然后在web项目中添加引用  在工具箱中添加控件

<DCWC:CHART id="CHART2" style="Z-INDEX: 107; LEFT: 24px; POSITION: absolute; TOP: 150px" runat="server"
     Width="705px" Height="448px" Palette="Pastel" ImageType="Png" BackColor="LightSteelBlue"
     BorderLineColor="LightSlateGray">
     <Legends>
      <dcwc:Legend Enabled="False" BorderColor="Gray" Name="Default" BackColor="Lavender" ShadowOffset="2"></dcwc:Legend>
     </Legends>
     <UI>
      <Toolbar>
       <BorderSkin PageColor=""></BorderSkin>
      </Toolbar>
     </UI>
     <BorderSkin FrameBackColor="SteelBlue" SkinStyle="FrameTitle5" PageColor="AliceBlue"></BorderSkin>
     <Series>
      <dcwc:Series BorderWidth="2" XValueType="DateTime" Name="Series1" ChartType="Line" BorderColor="64, 64, 64"
       ShadowOffset="1" YValueType="Double">
       <Points>
        <dcwc:DataPoint YValues="3000"></dcwc:DataPoint>
        <dcwc:DataPoint YValues="900"></dcwc:DataPoint>
        <dcwc:DataPoint YValues="60"></dcwc:DataPoint>
        <dcwc:DataPoint YValues="400"></dcwc:DataPoint>
        <dcwc:DataPoint YValues="4000"></dcwc:DataPoint>
       </Points>
      </dcwc:Series>
     </Series>
     <ChartAreas>
      <dcwc:ChartArea Name="Chart Area 1" BorderColor="" ShadowOffset="2" BackColor="Lavender">
       <AxisY StartFromZero="False">
        <MajorGrid LineStyle="Dash" LineColor="LightSteelBlue"></MajorGrid>
       </AxisY>
       <AxisX>
        <LabelStyle Format="T"></LabelStyle>
        <MajorGrid LineStyle="Dash" LineColor="LightSteelBlue"></MajorGrid>
       </AxisX>
      </dcwc:ChartArea>
     </ChartAreas>
    </DCWC:CHART>

 

 

 

 sql = "select time, value from analog_note_" + Convert.ToInt32(date2) + " WHERE analog_id=" + analog + " and  TIME BETWEEN '" + time1 + "' AND '" + time2+"'";
                MySqlDataReader myReader = DAL.MySqlHelper.ExecuteReader(CommandType.Text, sql);
                CHART2.Series["Series1"].Points.DataBindXY(myReader, "time", myReader, "value");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值