|
本帖最后由 ning84 于 2023-2-25 07:58 编辑
【Excel商务图表】南丁格尔玫瑰图表制作方法 http://www.360doc.com/content/22 ... 32_1044930952.shtml
下点功夫,把雷达图学会。制作南丁格尔玫瑰图表。
首先从xlPieExploded 69 分离型饼图开始,VBA测试,发现有12个SeriesCollection。结果是
- Sub del()
- Dim Chart As Chart
- Dim oChart As ChartObject
- For Each Chart In Charts
- Debug.Print Chart.Name
- Next Chart
- Set Chart = Charts(1)
- With Chart
- Debug.Print .Name, .Shapes.Count, .SeriesCollection.Count, .ChartType
- For ii = 1 To .SeriesCollection.Count
- Debug.Print .SeriesCollection.Item(ii).ChartType
- Next ii
- Stop
- End With
- End Sub
复制代码 录制宏,有了编制分离并图的思路。- Sub Macro1()
- '
- Charts.Add
- ActiveChart.ChartType = xlPieExploded
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection(1).Values = "={1,10,50}"
- ActiveChart.SeriesCollection(1).Name = "=""发"""
- ActiveChart.SeriesCollection(1).Points(1).Select
- With Selection.Border
- .ColorIndex = 57
- .Weight = xlThin
- .LineStyle = xlContinuous
- End With
- Selection.Shadow = False
- Selection.Fill.TwoColorGradient Style:=msoGradientHorizontal, Variant:=1
- With Selection
- .Fill.Visible = True
- .Fill.ForeColor.SchemeColor = 22
- .Fill.BackColor.SchemeColor = 13
- End With
- ActiveChart.ChartArea.Select
- End Sub
复制代码
|
|