在 series 集合編輯器 里找到雜項 customproperties 里的 pointwidth 設置
成都創(chuàng)新互聯(lián)公司于2013年成立,是專業(yè)互聯(lián)網(wǎng)技術服務公司,擁有項目成都網(wǎng)站設計、成都網(wǎng)站建設網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元太和做網(wǎng)站,已為上家服務,為太和各地企業(yè)和個人服務,聯(lián)系電話:028-86922220
引用microsoft chart control6.0(sp4)
添加mxchart空件
mxchart空件可以實現(xiàn)各種圖形,什么餅,柱,三角,線,都可以。而且可以是立體的。
chart控件和timer控件,用timer控件觸發(fā)chart控件中系列數(shù)據(jù)的更新。
'新建一個標準exe工程,畫一個command1,一個label,其index屬性設為0然后將代碼粘貼
Private Sub Command1_Click()
Static Ts As Integer
Ts = Ts + 1
x = InputBox("請輸入柱狀圖高度(1-19):")
If Val(x) 20 Or Val(x) = 0 Then
Ts = Ts - 1
MsgBox "請輸入0-19范圍的數(shù)"
Exit Sub
End If
Set newobj = Me.Controls.Add("vb.shape", "shape" Ts)
With newobj
.Shape = 0
.FillStyle = 5
.Left = 1 + 2 * Ts
.Top = 42 - x * 2
.Height = x * 2
.Width = 1
End With
newobj.Visible = True
End Sub
Private Sub Form_Load()
Me.Height = 9000
Me.Width = 19000
Me.AutoRedraw = True
Show
Me.ScaleHeight = 44 '將窗體的高設定為44份
Me.ScaleWidth = 50 '將窗體的寬設定為50份
'Me.Line.BorderColor = H0
Me.Line (2, 2)-(2, 42), H0 '畫出縱坐標
Me.Line (2, 42)-(48, 42), H0 '畫出橫坐標
Me.Line (48, 42)-(47.5, 41.5), H0 '畫出橫坐標上的箭頭
Me.Line (48, 42)-(47.5, 42.5), H0
Me.Line (2, 2)-(1.75, 3), H0 '畫出縱坐標上的箭頭
Me.Line (2, 2)-(2.25, 3), H0
Label1(0).Width = 20 '寫出坐標原點
Label1(0).Height = 20
Label1(0).AutoSize = ture
Label1(0).BackStyle = 0
Label1(0).FontItalic = True
Label1(0).FontBold = True
Label1(0).FontSize = 10
Label1(0).ForeColor = HFF
Label1(0).Caption = 0
Label1(0).Left = 1.5
Label1(0).Top = 42.5
Label1(0).Visible = True
For i = 1 To 45
Load Label1(i) '用數(shù)組的方法動態(tài)添加控件(橫坐標示數(shù))
Label1(i).Width = 40
Label1(i).Height = 20
Label1(i).AutoSize = ture
Label1(i).BackStyle = 0
Label1(i).FontItalic = True
Label1(i).FontBold = True
Label1(i).FontSize = 10
Label1(i).ForeColor = HFF
Label1(i).Caption = i
Label1(i).Left = 1.5 + i
Label1(i).Top = 42.5
Label1(i).Visible = True
'動態(tài)添加控件(橫坐標上的間隔線)
Set newobj = Me.Controls.Add("vb.line", "Line" i)
With newobj
.BorderStyle = 3
.X1 = i + 2
.X2 = i + 2
.Y1 = 41.8
.Y2 = 42.2
End With
newobj.Visible = True
Next i
For i = 46 To 70
Load Label1(i)
Label1(i).Width = 40
Label1(i).Height = 20
Label1(i).AutoSize = ture
Label1(i).BackStyle = 0
Label1(i).FontItalic = True
Label1(i).FontBold = True
Label1(i).FontSize = 10
Label1(i).ForeColor = HFF
Label1(i).Caption = i - 45
Label1(i).Left = 1
Label1(i).Top = (66 - i) * 2
If Val(Label1(i).Caption) 20 Then Label1(i).Visible = True
Set newobj = Me.Controls.Add("vb.line", "Line" i)
With newobj
.X1 = 1.9
.X2 = 2.1
.Y1 = 2 * (i - 44)
.Y2 = 2 * (i - 44)
'.BorderStyle = 3
End With
newobj.Visible = True
Next i
End Sub
三個辦法,你自己選擇吧。
1、用圖形,自己畫。不要以為這個是胡扯,實際上任何一個圖形控件都是通過GUI這么畫出來的。你自己寫代碼畫沒有想象中那么難。我曾經(jīng)自己寫了一個控件,實現(xiàn)任務管理器里面CPU占用率顯示的那個效果,代碼也不過百多行,比大多數(shù)人想的都要容易。
2、用 Microsoft Chart Controls。mschart絕大多數(shù)機器上都有,能提供基本的圖形顯示。操作比較簡單,相應的功能也比較簡單。但最常見的折線圖、餅圖、柱狀圖都是有的。
3、使用第三方控件。推薦 TeeChart,不過正版的要收費。你能在網(wǎng)上找到破解的老版本。功能強大,畫面漂亮、圖形種類繁多,有動態(tài)操作功能。什么坐標啊,頂點標簽啊,圖例啊等等全都有。
給個以前做的柱狀圖工程及代碼:
Option?Explicit
Dim?i?As?Long
Dim?record_jmm(10)?As?Single
Private?Sub?cmdExit_Click()
Unload?Me
End?Sub
Private?Sub?Form_Load()
For?i?=?0?To?30
Line?(350,?3960?+?i?*?141)-(450,?3960?+?i?*?141),?vbRed
Line?(1920?+?350,?3960?+?i?*?141)-(1920?+?450,?3960?+?i?*?141),?vbRed
Line?(1920?*?2?+?350,?3960?+?i?*?141)-(1920?*?2?+?450,?3960?+?i?*?141),?vbRed
Line?(1920?*?3?+?350,?3960?+?i?*?141)-(1920?*?3?+?450,?3960?+?i?*?141),?vbRed
Line?(1920?*?4?+?350,?3960?+?i?*?141)-(1920?*?4?+?450,?3960?+?i?*?141),?vbRed
Next
For?i?=?0?To?40
Line?(1920?*?5?+?450,?3960?+?i?*?105)-(1920?*?5?+?550,?3960?+?i?*?105),?vbRed
Next
For?i?=?0?To?4
Line?(1920?*?5?+?450,?3960?+?i?*?1050)-(1920?*?5?+?650,?3960?+?i?*?1050),?vbRed
Next
For?i?=?0?To?4
Line?(350?+?1920?*?i,?3960)-(350?+?1920?*?i,?3960?+?4235),?vbRed
Me.CurrentX?=?20?+?i?*?1920
Me.ForeColor?=?vbRed
Me.CurrentY?=?3880
Print?"150"
Me.CurrentX?=?20?+?i?*?1920
Me.CurrentY?=?3880?+?705
Print?"100"
Me.CurrentX?=?20?+?i?*?1920
Me.CurrentY?=?3880?+?705?*?2
Print?"?50"
Me.CurrentX?=?20?+?i?*?1920
Me.CurrentY?=?3880?+?705?*?3
Print?"??0"
Me.CurrentX?=?20?+?i?*?1920
Me.CurrentY?=?3880?+?705?*?4
Print?"-50"
Me.CurrentX?=?10?+?i?*?1920
Me.CurrentY?=?3880?+?705?*?5
Print?"-100"
Me.CurrentX?=?10?+?i?*?1920
Me.CurrentY?=?3880?+?705?*?6
Print?"-150"
Next
Me.CurrentX?=?20?+?5?*?1920
Me.ForeColor?=?vbYellow
Me.CurrentY?=?3880
Print?"10000"
Me.CurrentX?=?20?+?5?*?1920
Me.CurrentY?=?3880?+?1059
Print?"?1000"
Me.CurrentX?=?20?+?5?*?1920
Me.CurrentY?=?3880?+?1059?*?2
Print?"??100"
Me.CurrentX?=?20?+?5?*?1920
Me.CurrentY?=?3880?+?1059?*?3
Print?"???10"
Me.CurrentX?=?20?+?5?*?1920
Me.CurrentY?=?3880?+?1059?*?4
Print?"????1"
End?Sub
Private?Sub?Timer1_Timer()
For?i?=?0?To?5
PitBangtu(i).Cls
Next?i
PitBangtu(0).Line?(0,?2117.5?-?record_jmm(3)?*?42.35?/?3)-(1095,?4235),?vbRed,?BF
PitBangtu(1).Line?(0,?2117.5?-?record_jmm(4)?*?42.35?/?3)-(1095,?4235),?vbRed,?BF
PitBangtu(2).Line?(0,?2117.5?-?record_jmm(5)?*?42.35?/?3)-(1095,?4235),?vbRed,?BF
PitBangtu(3).Line?(0,?2117.5?-?record_jmm(6)?*?42.35?/?3)-(1095,?4235),?vbRed,?BF
PitBangtu(4).Line?(0,?2117.5?-?record_jmm(0)?*?42.35?/?3)-(1095,?4235),?vbRed,?BF
'PitBangtu(0).Line?(0,?2117.5?-?150?*?42.35?/?3)-(1095,?4235),?vbRed,?BF
If?Val(record_jmm(10))??10000?And?Val(record_jmm(10))?=?1000?Then
PitBangtu(5).Line?(0,?0?+?(10000?-?record_jmm(10))?*?0.1174)-(1095,?4235),?vbRed,?BF
ElseIf?Val(record_jmm(10))??1000?And?Val(record_jmm(10))?=?100?Then
PitBangtu(5).Line?(0,?1058.75?+?(1000?-?record_jmm(10))?*?1.1744)-(1095,?4235),?vbRed,?BF
ElseIf?Val(record_jmm(10))??100?And?Val(record_jmm(10))?=?10?Then
PitBangtu(5).Line?(0,?2117.5?+?(100?-?record_jmm(10))?*?11.744)-(1095,?4235),?vbRed,?BF
ElseIf?Val(record_jmm(10))??10?And?Val(record_jmm(10))?=?1?Then
PitBangtu(5).Line?(0,?3176.25?+?(10?-?record_jmm(10))?*?117.444)-(1095,?4235),?vbRed,?BF
End?If
End?Sub
網(wǎng)站標題:vb.net畫柱狀圖 c語言畫柱狀圖
地址分享:http://aaarwkj.com/article10/doodjgo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供微信小程序、Google、網(wǎng)站設計公司、移動網(wǎng)站建設、靜態(tài)網(wǎng)站、網(wǎng)站建設
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)