您的位置:首页 > 其它

AE中,用ZedGraph控件画柱状图、饼状图

2012-05-08 21:08 141 查看
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CreateGraph_GradientByZBars(XXXXXXXX) '折线图
End Sub

Private Sub CreateGraph_GradientByZBars(ByVal z1 As ZedGraphControl)
Dim myPane As GraphPane = z1.GraphPane
myPane.Title.Text = "Demonstration of Multi-Colored Bars with a Single BarItem"
myPane.XAxis.Title.Text = "Bar Number"
myPane.YAxis.Title.Text = "Value"

Dim list As New PointPairList()
Dim rand As New Random()

Dim i As Integer
For i = 0 To 15
Dim x As Double = CDbl(i) + 1
Dim y As Double = rand.NextDouble() * 1000
Dim z As Double = i / 4.0
list.Add(x, y, z)
Next i

Dim myCurve As BarItem = myPane.AddBar("Multi-Colored Bars", list, Color.Blue)
Dim colors As Color() = {Color.Red, Color.Yellow, Color.Green, Color.Blue, Color.Purple}
myCurve.Bar.Fill = New Fill(colors)
myCurve.Bar.Fill.Type = FillType.GradientByZ

myCurve.Bar.Fill.RangeMin = 0
myCurve.Bar.Fill.RangeMax = 4

myPane.Chart.Fill = New Fill(Color.White, Color.FromArgb(220, 220, 255), 45)
myPane.Fill = New Fill(Color.White, Color.FromArgb(255, 255, 225), 45)
' Tell ZedGraph to calculate the axis ranges
z1.AxisChange()
End Sub 'CreateGraph_GradientByZBars
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: