189 8069 5689

vb.net圆饼图,winform饼图

用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可以做出饼图吗

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.net该如何将图片圆形显示?

新建一个Winform,拖两个图片框。图片框1在设计器中选择一个图片(尺寸在图片框容纳为佳)。如下代码测试通过:

private void button1_Click(object sender, EventArgs e)

{

Image img1 = this.pictureBox1.Image;

Image img2 = CropToCircle(img1);

this.pictureBox2.Image = img2;

}

public Image CropToCircle(Image img1)

{

Image img2 = new Bitmap(img1.Width, img1.Height, 

img1.PixelFormat);

Graphics g = Graphics.FromImage(img2);

using (Brush br = 

new SolidBrush(SystemColors.Control))//背景色

{

g.FillRectangle(br, 0, 0, 

img2.Width, img2.Height);

}

GraphicsPath path = new GraphicsPath();

path.AddEllipse(0, 0, img2.Width, img2.Height);

g.SetClip(path);

g.DrawImage(img1, 0, 0);

return img2;

}

我想问下,讲数据保存到excel中后,如何在VB.net中继续写代码,使得能够将这些数据生成一个饼图?并保存。

用宏功能啊,然后把宏代码(vb6.0)转化为Vb.net代码,有一个关键问题,就是VBA中的枚举类型在Vb.net中不适用,比如.End(xlUp)更改为.End(3)就能运行,另外vb.net中运行Excel对象不一定在点后会出现智能提示(即使你引用后也一样)你只要确定有该方法或者属性,直接写就是了,生成或者调试都是可以通过的

VB 如何画饼图?

给你一个步骤吧.

设立一个圆心(即定一个点)

再按照用PI转角来画就行了.

最后加上你需要的颜色

vb.net 控制excel画饼状图

我自己写的控件,里面有示例程序,很简单的。不过饼图只设置了12种颜色。。。只能显示12项


当前标题:vb.net圆饼图,winform饼图
当前网址:http://cdxtjz.cn/article/heehic.html

其他资讯