我想问下,讲数据保存到excel中后,如何在VB.net中继续写代码,使得能够将这些数据生成一个饼图?并保存 。用宏功能啊 , 然后把宏代码(vb6.0)转化为Vb.net代码,有一个关键问题 , 就是VBA中vb.net饼状图的枚举类型在Vb.net中不适用,比如.End(xlUp)更改为.End(3)就能运行,另外vb.net中运行Excel对象不一定在点后会出现智能提示(即使vb.net饼状图你引用后也一样)vb.net饼状图你只要确定有该方法或者属性,直接写就是了,生成或者调试都是可以通过的
用vb.net可以做出饼图吗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)
vb.net2005怎么做曲线统计图啊 。画饼图的例子 ,
Me.LoadDriveInfo(DrivesOnPc.Items(DrivesOnPc.SelectedIndex)) 计算比例大小
Me.Invalidate()触发窗体绘图
'窗体画图(饼图)
Private Sub form3_paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
'设定RECTANGLE结构变量,确定画图的范围及大小
Dim rect As Rectangle = New Rectangle(280, 20, 200, 200)
Dim rect2 As Rectangle = New Rectangle(270, 10, 400, 320)
Dim freelegend As Rectangle = New Rectangle(280, 300, 20, 20)
Dim usedlegend As Rectangle = New Rectangle(280, 275, 20, 20)
e.Graphics.DrawRectangle(Pens.Black, rect2)
e.Graphics.DrawLine(Pens.Black, 270, 260, 670, 260)
If Me.isSpaceInfoVailable = True Then
'填充椭圆图像(角度)
e.Graphics.FillPie(Brushes.Magenta, rect, 0, Sweep)
e.Graphics.FillPie(Brushes.Blue, rect, Sweep, 360 - Sweep)
'填充方形
e.Graphics.FillRectangle(Brushes.Magenta, freelegend)
e.Graphics.FillRectangle(Brushes.Blue, usedlegend)
e.Graphics.DrawString(
vb.net中怎样曲线图,棒图,和饼图vb2010以后的版本就自带Chart控件了,比如
Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Pie '饼图
用VB中的mschart控件画一个饼状图 , 要怎么画?先在“部件”里选上“Microsoft Chart Control 6.0”,并添加一个MSChart1 。
Private Sub Form_Load()
With MSChart1
.chartType = VtChChartType2dPie '表示饼图
.ColumnCount = 3 '这里是每个饼图的数据个数
.ColumnLabel = "你的数据名称"
.RandomFill = True '暂且用随机数填图,数据请自己输入
.RowCount = 2 '你说的“画两部分的饼状图就成”
.RowLabel = "你的数据标签"
.TitleText = "你的图表名称"
End With
End Sub
【vb.net饼状图 visio饼状图】关于vb.net饼状图和visio饼状图的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- 红帽格斗游戏,红帽挑战赛
- mysql推数据到kafka,mysql kafka
- 显卡跑矿怎么赚钱的,显卡挖矿能赚到钱吗
- 视频号点赞怎么这么少,视频号点赞没有红点显示吗
- mysql数据库怎么开 mysql数据库怎么打开命令窗口
- 怎么下载mp4视频到u盘,怎么下载mp4视频到u盘上
- thinkphp模版为空,thinkphp模板缓存
- 网站源代码java,网站源代码快捷键
- mysql班级怎么写 以下哪项是指曾经感知过的事物在大脑中留下的印象