Mmmm....
Código ASP:
Ver originalPrivate Sub CreateGraph_DataSource(z1 As ZedGraphControl)
Dim myPane As GraphPane = z1.GraphPane
' Set the titles
myPane.Title.Text = "DataSourcePointList Test"
myPane.XAxis.Title.Text = "Date"
myPane.YAxis.Title.Text = "Freight Charges ($US)"
' Create a new DataSourcePointList to handle the database connection
Dim dspl As New DataSourcePointList()
' Create a TableAdapter instance to access the database
Dim adapter As New NorthwindDataSetTableAdapters.OrdersTableAdapter()
' Create a DataTable and fill it with data from the database
Dim table As NorthwindDataSet.OrdersDataTable = adapter.GetData()
' Specify the table as the data source
dspl.DataSource = table
' The X data will come from the "OrderDate" column
dspl.XDataMember = "OrderDate"
' The Y data will come from the "Freight" column
dspl.YDataMember = "Freight"
' The Z data are not used
dspl.ZDataMember = Nothing
' The Tag data will come from the "ShipName" column
' (note that this will just set PointPair.Tag = ShipName)
dspl.TagDataMember = "ShipName"
' X axis will be dates
z1.GraphPane.XAxis.Type = AxisType.[Date]
' Make a curve
Dim myCurve As LineItem = z1.GraphPane.AddCurve("Orders", dspl, Color.Blue)
' Turn off the line so it's a scatter plot
myCurve.Line.IsVisible = False
' Show the point values. These are derived from the "ShipName" database column,
' which is set as the "Tag" property.
z1.IsShowPointValues = True
' Auto set the scale ranges
z1.AxisChange()
End Sub