首先下载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");