vba Excel 2010 中带条形图的折线图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8424855/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Line Graph with Bar Graph in Excel 2010
提问by gagneet
I have a requirement to create a Bar graph for the results of the current time period and along with that a line graph which displays the previous time period, this is using a Excel 2010 Workbook.
我需要为当前时间段的结果创建一个条形图,以及一个显示前一个时间段的折线图,这是使用 Excel 2010 工作簿。
Is the above graph type possible in Excel 2003 or Excel 2010 Work Books? If so, how do I do the same?
Excel 2003 或 Excel 2010 工作簿中是否可以使用上述图形类型?如果是这样,我该怎么做?
I read somewhere that a XY Cluster graph would do the trick, but have not been able to reproduce the same effect.
我在某处读到 XY 集群图可以解决问题,但无法重现相同的效果。
回答by Tim Williams
Slightly tidied-up recorded macro:
稍微整理一下录制的宏:
With ActiveSheet.Shapes.AddChart.Chart
.SetSourceData Source:=Range("'Sheet1'!$B:$E")
.ChartType = xlColumnClustered
.SeriesCollection(3).ChartType = xlLine
End With
Source data for my example:
我的示例的源数据:
Month Series1 Series2 Series3
J 10 15 5
F 20 30 10
M 30 45 15
A 40 60 45
M 50 75 72
Jun 60 90 24
Jul 70 105 35