The zedgraph graphical control is used to generate images. There are many things that need to be studied further.

Source: Internet
Author: User

Imports zedgraph
Imports system. Drawing

Public class graph
Inherits system. Web. UI. Page

Dim ls_projid as string = ""

Protected sub zedgraphweb2_rendergraph (byval Z as zedgraph. Web. zedgraphweb ,_
Byval G as system. Drawing. Graphics ,_
Byval masterpane as zedgraph. masterpane) handles zedgraphweb2.rendergraph

'Get the graphpane so we can work with it
Dim mypane as graphpane = masterpane (0)

'set the titles and axis labels
mypane. title. TEXT = "project progress report"
mypane. xaxis. title. TEXT = "date"
mypane. yaxis. title. TEXT = "progress"
'progress bar 0-100
mypane. yaxis. scale. min = 0
mypane. yaxis. scale. max = 100
'mypane. yaxis. scale. mingrace = 0.2
'mypane. yaxis. scale. maxgrace = 0.2
'mypane. y2axis. scale. mingrace = 0.2
'mypane. y2axis. scale. maxgrace = 0.2

'Make up some data points from the sine function
Dim list as new pointpairlist ()
Dim list2 as new pointpairlist ()

Dim I as integer, X as double, y as double, Y2 as double

Dim D as date

'Get the corresponding ID
Dim ds as Dataset
DS = config. getds ("select achievedate, targetprogress, factprogress from tbl_projectprogress where id_inproject = '" & ls_projid & "'order by achievedate ")
If Ds. Tables (0). Rows. Count> 0 then
For I = 0 to DS. Tables (0). Rows. Count-1
D = Ds. Tables (0). Rows (I) ("achievedate ")
X = new xdate (d)
Y = Ds. Tables (0). Rows (I) ("targetprogress ")
Y2 = Ds. Tables (0). Rows (I) ("factprogress ")
List. Add (x, y)
List2.add (x, Y2)
Next I
End if

'D = "2008-3-2"
'X = new xdate (d)
'Y = 10
'Y2 = 5
'List. Add (x, y)
'List2. Add (x, Y2)

'For I = 0 to 35
'X = new xdate (1995, I + 1, 1)
'Y = math. Sin (I * Math. PI/15.0)
'Y2 = 2 * y

'List. Add (x, y)
'List2.add (x, Y2)
'Next I

'Generate a blue curve with circle symbols, and "my curve 2" in the legend
Dim mycurve2 as lineitem = mypane. addcurve ("target progress", list, color. Blue ,_
Symboltype. Circle)
'Fill the area under the curve with a white-red gradient at 45 degrees
'Mycurve2. Line. Fill = New fill (color. White, color. Red, 45.0f)

'Make the symbols opaque by filling them with white
Mycurve2.symbol. Fill = New fill (color. White)

'Generate a red curve with diamond symbols, and "my curve" in the legend
Dim mycurve as lineitem = mypane. addcurve ("Actual Progress ",_
List2, color. mediumvioletred, symboltype. Diamond)

'Fill the area under the curve with a white-green gradient
'Mycurve. Line. Fill = New fill (color. White, color. Green)

'Make the symbols opaque by filling them with white
Mycurve. symbol. Fill = New fill (color. White)

'Set the xaxis to date type
Mypane. xaxis. type = axistype. Date
Mypane. xaxis. crossauto = true

'Fill the axis background with a color gradient
Mypane. Chart. Fill = New fill (color. White, color. lightgoldenrodyellow, 45.0f)
Masterpane. axischange (g)
End sub

Protected sub page_load (byval sender as object, byval e as system. eventargs) handles me. Load
If not page. ispostback then
Dim sqlstr as string
Dim ds as Dataset
Dim I as integer
Sqlstr = "select ID, itemdes from DBO. tbl_project where parentid = '0' and status = '1 '"
DS = config. getds (sqlstr)

Drpproject. Items. Add ("select ")
Drpproject. Items (0). value = ""

If Ds. tables (0 ). rows. count> 0 then
for I = 0 to DS. tables (0 ). rows. count-1
drpproject. items. add (Ds. tables (0 ). rows (I) ("itemdes")
drpproject. items (I + 1 ). value = Ds. tables (0 ). rows (I) ("ID")
next I
end if
end sub

Protected sub cmdshow_click (byval sender as object, byval e as system. eventargs) handles cmdshow. Click
Ls_projid = drpproject. selectedvalue
End sub

End Class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.