怎么画饼状图?
怎么根据数据来画饼状图?求指教,急 --------------------编程问答-------------------- Private Sub Command4_Click()FillStyle = 0
FillColor = 255
Circle (500, 500), 300, 255, -3.14159 / 4, -3.1415926 * 3 / 2
End Sub
红色参数为角度的起点和终点,注意,其值必须为负数
--------------------编程问答--------------------
--------------------编程问答-------------------- 也可以用MSChart.ocx控件 --------------------编程问答--------------------
Sub Macro1()
'
' Macro1 Macro
' ºêÓÉ Î¢ÈíÓû§ ¼ÖÆ£¬Ê±¼ä: 2012-5-14
'
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "25"
Range("A2").Select
ActiveCell.FormulaR1C1 = "35"
Range("A3").Select
ActiveCell.FormulaR1C1 = "20"
Range("A4").Select
ActiveCell.FormulaR1C1 = "20"
Range("A1:A4").Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets("Sheet3").Range("A1:A4"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet3"
ActiveChart.HasTitle = False
End Sub
Option Explicit
Private Sub Form_Load()
Dim myData(0 To 4) As Integer
Dim intP As Integer
For intP = 0 To 4
myData(intP) = intP + 1
Next intP
MSChart1.chartType = VtChChartType2dPie
MSChart1.ChartData = myData 'Êý¾Ý
End Sub
补充:VB , 基础类