ExcelTip.Net留存知识帖 ---【注:附件之前被网盘供应商清空后,现已修复-现已修复-现已修复为本地下载!】
现在位置:首页 > 我的酷贴 > Excel VBA > Chart.SetElement方法的运用

Chart.SetElement方法的运用

作者:绿色风 分类: 时间:2022-08-18 浏览:110
楼主
biaotiger1
在EXCEL2007版本以后增加了一个Chart.SetElement方法,该方法通过设置相应参数返回对应图表的相应设置。
EXCEL2010中的帮助如下

具体可通过录制宏的方式得到(详见如下动画)。

 

该方法的具体应用参见如下帖子
[VBA] 如何使用VBA为图表添加显示数值的数据标签并居中显示? http://www.exceltip.net/thread-8462-1-1.html

[VBA] 如何使用VBA一次性删除图表中的所有误差线? http://www.exceltip.net/thread-8456-1-1.html

[VBA] 如何利用VBA显示和隐藏图表的数据表? http://www.exceltip.net/thread-8431-1-1.html

[VBA] 如何利用VBA快速添加图表系列的误差线? http://www.exceltip.net/thread-5788-1-1.html
2楼
biaotiger1
补充参数列表及说明
名称说明
msoElementChartFloorNone1200不显示图表基底。
msoElementChartFloorShow1201显示图表基底。
msoElementChartTitleAboveChart2在图表上方显示标题。
msoElementChartTitleCenteredOverlay1将标题显示为居中覆盖。
msoElementChartTitleNone0不显示图表标题。
msoElementChartWallNone1100不显示图表背景墙。
msoElementChartWallShow1101显示图表背景墙。
msoElementDataLabelBestFit210使用数据标签最佳位置。
msoElementDataLabelBottom209在底部显示数据标签。
msoElementDataLabelCenter202居中显示数据标签。
msoElementDataLabelInsideBase204在底端内侧显示数据标签。
msoElementDataLabelInsideEnd203在顶端内侧显示数据标签。
msoElementDataLabelLeft206靠左显示数据标签。
msoElementDataLabelNone200不显示数据标签。
msoElementDataLabelOutSideEnd205在顶端外侧显示数据标签。
msoElementDataLabelRight207靠右显示数据标签。
msoElementDataLabelShow201显示数据标签。
msoElementDataLabelTop208在顶部显示数据标签。
msoElementDataTableNone500不显示模拟运算表。
msoElementDataTableShow501显示模拟运算表。
msoElementDataTableWithLegendKeys502显示带图例项标示的模拟运算表。
msoElementErrorBarNone700不显示误差线。
msoElementErrorBarPercentage702显示百分比误差线。
msoElementErrorBarStandardDeviation703显示标准偏差误差线。
msoElementErrorBarStandardError701显示标准误差线。
msoElementLegendBottom104在底部显示图例。
msoElementLegendLeft103在左侧显示图例。
msoElementLegendLeftOverlay106在左侧叠放图例。
msoElementLegendNone100不显示图例。
msoElementLegendRight101在右侧显示图例。
msoElementLegendRightOverlay105在右侧叠放图例。
msoElementLegendTop102在顶部显示图例。
msoElementLineDropHiLoLine804显示垂直线和高/低线。
msoElementLineDropLine801显示垂直线。
msoElementLineHiLoLine802显示高/低线。
msoElementLineNone800不显示线。
msoElementLineSeriesLine803显示系列线。
msoElementPlotAreaNone1000不显示绘图区。
msoElementPlotAreaShow1001显示绘图区。
msoElementPrimaryCategoryAxisBillions374使用十亿作为主分类轴单位。
msoElementPrimaryCategoryAxisLogScale375对主分类轴使用对数刻度。
msoElementPrimaryCategoryAxisMillions373使用百万作为主分类轴单位。
msoElementPrimaryCategoryAxisNone348不显示主分类轴。
msoElementPrimaryCategoryAxisReverse351反转主分类轴。
msoElementPrimaryCategoryAxisShow349显示主分类轴。
msoElementPrimaryCategoryAxisThousands372使用千作为主分类轴单位。
msoElementPrimaryCategoryAxisTitleAdjacentToAxis301紧邻轴显示主分类轴标题。
msoElementPrimaryCategoryAxisTitleBelowAxis302在轴下方显示主分类轴标题。
msoElementPrimaryCategoryAxisTitleHorizontal305水平显示主分类轴标题。
msoElementPrimaryCategoryAxisTitleNone300不显示主分类轴标题。
msoElementPrimaryCategoryAxisTitleRotated303旋转主分类轴标题。
msoElementPrimaryCategoryAxisTitleVertical304垂直显示主分类轴标题。
msoElementPrimaryCategoryAxisWithoutLabels350无标签显示主分类轴。
msoElementPrimaryCategoryGridLinesMajor334沿主分类轴显示主要网格线。
msoElementPrimaryCategoryGridLinesMinor333沿主分类轴显示次要网格线。
msoElementPrimaryCategoryGridLinesMinorMajor335沿主分类轴同时显示主要网格线和次要网格线。
msoElementPrimaryCategoryGridLinesNone332不沿主分类轴显示网格线。
msoElementPrimaryValueAxisBillions356使用十亿作为主数值轴单位。
msoElementPrimaryValueAxisLogScale357对主数值轴使用对数刻度。
msoElementPrimaryValueAxisMillions355使用百万作为主数值轴单位。
msoElementPrimaryValueAxisNone352不显示主数值轴。
msoElementPrimaryValueAxisShow353显示主数值轴。
msoElementPrimaryValueAxisThousands354使用千作为主数值轴单位。
msoElementPrimaryValueAxisTitleAdjacentToAxis306紧邻轴放置主数值轴标题。
msoElementPrimaryValueAxisTitleBelowAxis308在轴下方放置主数值轴标题。
msoElementPrimaryValueAxisTitleHorizontal311水平显示主数值轴标题。
msoElementPrimaryValueAxisTitleNone306不显示主数值轴标题。
msoElementPrimaryValueAxisTitleRotated309旋转主数值轴标题。
msoElementPrimaryValueAxisTitleVertical310垂直显示主数值轴标题。
msoElementPrimaryValueGridLinesMajor330沿主数值轴显示主要网格线。
msoElementPrimaryValueGridLinesMinor329沿主数值轴显示次要网格线。
msoElementPrimaryValueGridLinesMinorMajor331沿主数值轴同时显示主要网格线和次要网格线。
msoElementPrimaryValueGridLinesNone328不沿主数值轴显示网格线。
msoElementSecondaryCategoryAxisBillions378使用十亿作为次分类轴单位。
msoElementSecondaryCategoryAxisLogScale379对次分类轴使用对数刻度。
msoElementSecondaryCategoryAxisMillions377使用百万作为次分类轴单位。
msoElementSecondaryCategoryAxisNone358不显示次分类轴。
msoElementSecondaryCategoryAxisReverse361反转次分类轴。
msoElementSecondaryCategoryAxisShow359显示次分类轴。
msoElementSecondaryCategoryAxisThousands376使用千作为次分类轴单位。
msoElementSecondaryCategoryAxisTitleAdjacentToAxis313紧邻轴显示次分类轴标题。
msoElementSecondaryCategoryAxisTitleBelowAxis314在轴下方显示次分类轴标题。
msoElementSecondaryCategoryAxisTitleHorizontal317水平显示次分类轴标题。
msoElementSecondaryCategoryAxisTitleNone312不显示次分类轴标题。
msoElementSecondaryCategoryAxisTitleRotated315旋转次分类轴标题。
msoElementSecondaryCategoryAxisTitleVertical316垂直显示次分类轴标题。
msoElementSecondaryCategoryAxisWithoutLabels360无标签显示次分类轴。
msoElementSecondaryCategoryGridLinesMajor342沿次分类轴显示主要网格线。
msoElementSecondaryCategoryGridLinesMinor341沿次分类轴显示次要网格线。
msoElementSecondaryCategoryGridLinesMinorMajor343沿次分类轴同时显示主要网格线和次要网格线。
msoElementSecondaryCategoryGridLinesNone340不沿次分类轴显示网格线。
msoElementSecondaryValueAxisBillions366使用十亿作为次数值轴单位。
msoElementSecondaryValueAxisLogScale367对次数值轴使用对数刻度。
msoElementSecondaryValueAxisMillions365使用百万作为次数值轴单位。
msoElementSecondaryValueAxisNone362不显示次数值轴。
msoElementSecondaryValueAxisShow363显示次数值轴。
msoElementSecondaryValueAxisThousands364使用千作为次数值轴单位。
msoElementSecondaryValueAxisTitleAdjacentToAxis319紧邻轴显示次数值轴标题。
msoElementSecondaryValueAxisTitleBelowAxis320在轴下方显示次数值轴标题。
msoElementSecondaryValueAxisTitleHorizontal323水平显示次数值轴标题。
msoElementSecondaryValueAxisTitleNone318不显示次数值轴标题。
msoElementSecondaryValueAxisTitleRotated321旋转次数值轴标题。
msoElementSecondaryValueAxisTitleVertical322垂直显示次数值轴标题。
msoElementSecondaryValueGridLinesMajor338沿次数值轴显示主要网格线。
msoElementSecondaryValueGridLinesMinor337沿次数值轴显示次要网格线。
msoElementSecondaryValueGridLinesMinorMajor339沿次数值轴同时显示主要网格线和次要网格线。
msoElementSecondaryValueGridLinesNone336不沿次数值轴显示网格线。
msoElementSeriesAxisGridLinesMajor346沿系列轴显示主要网格线。
msoElementSeriesAxisGridLinesMinor345沿系列轴显示次要网格线。
msoElementSeriesAxisGridLinesMinorMajor347沿系列轴同时显示主要网格线和次要网格线。
msoElementSeriesAxisGridLinesNone344不沿系列轴显示网格线。
msoElementSeriesAxisNone368不显示系列轴。
msoElementSeriesAxisReverse371反转系列轴。
msoElementSeriesAxisShow369显示系列轴。
msoElementSeriesAxisTitleHorizontal327水平显示系列轴标题。
msoElementSeriesAxisTitleNone324不显示系列轴标题。
msoElementSeriesAxisTitleRotated325旋转系列轴标题。
msoElementSeriesAxisTitleVertical326垂直显示系列轴标题。
msoElementSeriesAxisWithoutLabeling370不带标签显示系列轴标题。
msoElementTrendlineAddExponential602添加指数趋势线。
msoElementTrendlineAddLinear601添加线性趋势线。
msoElementTrendlineAddLinearForecast603添加线性预测。
msoElementTrendlineAddTwoPeriodMovingAverage604添加双周期移动平均。
msoElementTrendlineNone600不显示趋势线。
msoElementUpDownBarsNone900不显示涨/跌柱线。
msoElementUpDownBarsShow901显示涨/跌柱线。

免责声明

有感于原ExcelTip.Net留存知识的价值及部分知识具有的时间限定性因素, 经与ExcelTip.Net站长Apolloh商议并征得其同意, 现将原属ExcelTip.Net的知识帖采集资料于本站点进行展示, 供有需要的人士查询使用,也慰缅曾经的论坛时代。 所示各个帖子的原作者如对版权有异议, 可与本人沟通提出,或于本站点留言,我们会尽快处理。 在此,感谢ExcelTip.Net站长Apolloh的支持,感谢本站点所有人**绿色风(QQ:79664738)**的支持与奉献,特此鸣谢!
------本人网名**KevinChengCW(QQ:1210618015)**原ExcelTip.Net总版主之一

评论列表
sitemap