如何使用一个栏项目创建zedgraph [英] How can i create a zedgraph with one bar items

查看:68
本文介绍了如何使用一个栏项目创建zedgraph的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个zedgrpah,我想用一个栏创建一个栏项目
有什么主意吗?

I have a zedgrpah and i want to create a bar items with one bar
is there any idea?

推荐答案

这是我的代码. ..有两个条...

Private Sub zedgraph01(ByVal z2 As ZedGraphControl)
将myPane1设为GraphPane = z2.GraphPane
myPane1.Title.Text =检查"每天的站点数''
myPane1.XAxis.Title.Text ="Premium"

昏暗列表1作为新PointPairList
昏暗rad1作为新的随机

昏暗i1作为Integer >对于i1 = 0到1
Dim x As Double = CDbl(i1)+ 1
Dim y As Double = 70
list1.Add(x,y)
<1> br> Dim myCurve1 As BarItem = myPane1.AddBar("M",list1,Color.Blue)
Dim colors1 As Color()= {Color.Red,Color.Yellow}
myCurve1.Bar.Fill =新建Fill(colors1)
myCurve1.Bar.Fill.Type = FillType.GradientByX


myCurve1.Bar.Fill.RangeMin = 0
1.Bar.Fill.RangeMax = 5

myPane1.Chart.Fill =新建Fill(Color.White,Color.FromArgb(220,220,255),45)
z2.AxisChange()
end sub

私有子目录frmRefcheckstation1_Load(ByVal发送者作为对象,ByVal e作为System.EventArgs)处理Me.Load

CreateGraph_GradientByZBars(Zed1)
结束子

>它显示两个条形...
Here's my code...with two bars...

Private Sub zedgraph01(ByVal z2 As ZedGraphControl)

Dim myPane1 As GraphPane = z2.GraphPane
        myPane1.Title.Text = "Checking Of Station Per Day"
        myPane1.XAxis.Title.Text = "Premium"

        Dim list1 As New PointPairList
        Dim rad1 As New Random
        Dim i1 As Integer

        For i1 = 0 To 1
            Dim x As Double = CDbl(i1) + 1
            Dim y As Double = 70
            list1.Add(x, y)
        Next i1

        Dim myCurve1 As BarItem = myPane1.AddBar("M", list1, Color.Blue)
        Dim colors1 As Color() = {Color.Red, Color.Yellow}
        myCurve1.Bar.Fill = New Fill(colors1)
        myCurve1.Bar.Fill.Type = FillType.GradientByX

        myCurve1.Bar.Fill.RangeMin = 0
        myCurve1.Bar.Fill.RangeMax = 5

        myPane1.Chart.Fill = New Fill(Color.White, Color.FromArgb(220, 220, 255), 45)
        z2.AxisChange()
end sub

Private Sub frmRefcheckstation1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        CreateGraph_GradientByZBars(Zed1)
            End Sub

It's display a two bars...


这篇关于如何使用一个栏项目创建zedgraph的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆