2009年9月21日 星期一

WebChart

好用的統計圖工具~ http://www.carlosag.net/Tools/WebChart/Default.aspx 下載WebChart.dll後 到工具箱新增/移除項目 新增.NET Framework元件
Imports WebChart
Private Sub CreateChart()
'ChartControl1.YCustomStart = Session("ds_chart").Rows(0).Item(7) - 0.5 '定義Y軸的起始點
'ChartControl1.YCustomEnd = Session("ds_chart").Rows(0).Item(7) + 0.5 '定義Y軸的結束點
ChartControl1.ChartTitle.Text = "50筆最新資料" '定義Title名稱
Dim chart As LineChart = New LineChart
chart.Line.Color = Color.Green 'Line的顏色
chart.Legend = "值" '代表Line的名稱
Dim chart1 As LineChart = New LineChart
chart1.Line.Color = Color.Blue
chart1.Legend = "實測尺碼"
Dim chart2 As LineChart = New LineChart
chart2.Line.Color = Color.Red
chart2.Legend = "差值"
For Each row As DataRow In Session("ds_chart").Rows '讀Dateset的值
chart.Data.Add(New ChartPoint(row("值").ToString, CType(row("值"), Integer)))
chart1.Data.Add(New ChartPoint(row("實測尺碼").ToString, CType(row("實測尺碼"), Integer)))
chart2.Data.Add(New ChartPoint(row("差值").ToString, CType(row("差值"), Integer)))
Next
ChartControl1.Charts.Add(chart)
ChartControl1.Charts.Add(chart1)
ChartControl1.Charts.Add(chart2)
ChartControl1.RedrawChart()
End Sub

沒有留言:

張貼留言