十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專業(yè)推廣+無(wú)憂售后,網(wǎng)站問(wèn)題一站解決
我自己寫的控件,里面有示例程序,很簡(jiǎn)單的。不過(guò)餅圖只設(shè)置了12種顏色。。。只能顯示12項(xiàng)
陵城ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書合作)期待與您的合作!
Dim MyGraphics As Graphics = Me.PictureBox1.CreateGraphics
Dim MyBrush As New SolidBrush(Color.Red)
Dim MyProportion As Single
Dim MyRect As New Rectangle
Dim MyPoint As New PointF
Dim R As Single
Const PI = 3.1415926
MyGraphics.Clear(Color.White)
Dim MyStartAngel As Double
Dim MySweepAngel As Double
R = Math.Min(Me.PictureBox1.Width, Me.PictureBox1.Height) / 2 - 15
MyPoint.X = Me.PictureBox1.Width / 2
MyPoint.Y = Me.PictureBox1.Height / 2
MyRect.X = MyPoint.X - R
MyRect.Y = MyPoint.Y - R
MyRect.Width = R * 2
MyRect.Height = R * 2
MyStartAngel = 0
MyProportion = Val(TextBox7.Text)
MySweepAngel = MyProportion * 360 / PI
MyBrush.Color = Color.Red
MyGraphics.FillPie(MyBrush, MyRect, MyStartAngel, MySweepAngel)
' MyStartAngel = MyStartAngel + MySweepAngel
MyProportion = 0.75
MySweepAngel = 360 * MyProportion
MyBrush.Color = Color.Blue
MyGraphics.FillPie(MyBrush, MyRect, MyStartAngel, MySweepAngel)
vb2010以后的版本就自帶Chart控件了,比如
Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Pie '餅圖
用宏功能啊,然后把宏代碼(vb6.0)轉(zhuǎn)化為Vb.net代碼,有一個(gè)關(guān)鍵問(wèn)題,就是VBA中的枚舉類型在Vb.net中不適用,比如.End(xlUp)更改為.End(3)就能運(yùn)行,另外vb.net中運(yùn)行Excel對(duì)象不一定在點(diǎn)后會(huì)出現(xiàn)智能提示(即使你引用后也一樣)你只要確定有該方法或者屬性,直接寫就是了,生成或者調(diào)試都是可以通過(guò)的