.ChartType =54
.Elevation =45&&20
.Rotation =25 && 25
.GapDepth =0
.Axes(2).HasTitle =.T.
.Axes(2).AxisTitle.Text = "指标值"
*.Axes(2).AxisTitle.Orientation = -45 && 这是整体旋转
我想让“指标值” 显示为
指
标
值
怎么操作? 宏录不出来这个操作的代码。
11 个解决方案
#1
oExcel.ActiveChart.Axes(2).AxisTitle.Orientation = -4166
#2
谢谢老大。只不过,您怎么知道的啊。
#3
我不信邪,也录个宏就看到了啊
#4
这个我当时看到了,xlvertical 这种常量,对应的值,我在哪儿能找到啊。
PROCEDURE prdLineChart
PARAMETERS m.cRange,m.cChartName,m.cChartTitle,sxcap,sycap
.sheets("统计分析" ).Select
.sheets("统计分析" ).Range(m.cRange).Select
.Charts.Add
WITH .ActiveChart
.Name =fncTran('折线图')+m.cChartName
.ChartType =65
.HasTitle =.T.
.HasLegend =.T.
.HasDatatable=.F. && 这个柱状图,上能控制不让图表上显示数据 为什么不起作用??????
.ApplyDataLabels
WITH .Axes(1)
*.HasTitle =.T.
*.AxisTitle.Text = "指标值"
.HasMajorGridLines =.T.
.HasMinorGridLines =.T.
WITH .TickLabels
.Orientation =-4166 &&90
.Font.Size =12
.Font.Name ='Arial'
ENDWITH
ENDWITH
WITH .Axes(2)
.HasTitle =.T.
.AxisTitle.Text = sycap
.AxisTitle.Orientation = -4166
.HasMajorGridLines =.T.
.HasMinorGridLines =.T.
.TickLabels.Font.Size =12
.TickLabels.Font.Name ='Arial'
ENDWITH
WITH .SeriesCollection(1)
WITH .Border
*.ColorIndex =7
.Weight =3
ENDWITH
WITH .DataLabels
.Border.LineStyle =-4105
.Position =0
.Font.Size =12
.Font.Name ='Arial'
*.Interior.ColorIndex =17
.Shadow =.F.
.ShowValue=.F. && 这个柱状图,上能控制不让图表上显示数据 为什么话拆线图上不起作用?
ENDWITH
.Shadow =.F.
.Smooth =.T.
ENDWITH
WITH .PlotArea
.Border.LineStyle =0
*.Interior.ColorIndex =2
ENDWITH
WITH .ChartTitle.Characters
.Text =UPPER(m.cChartName)
WITH .Font
.Size =12
.Bold =.T.
.Name ='Arial'
ENDWITH
ENDWITH
.PageSetup.CenterHeader =m.cChartTitle
ENDWITH
ENDPROC
这是我录的代码,折线图上有两条线 需要再选择中具体哪条线?
ActiveSheet.ChartObjects("图表 1").Activate
Selection.ShowValue = True
Selection.ShowSeriesName = True
Selection.ShowSeriesName = False
Selection.ShowValue = False
是不是要从这个东西下手? ActiveChart.Axes(xlCategory).MajorGridlines.Select
#5
#6
*柱图代码
PROCEDURE prdColumnWithDepthChart
PARAMETERS m.cRange,m.cChartName,m.nBarShape,m.cChartTitle,sxcap,sycap
.sheets("统计分析" ).Select
.sheets("统计分析" ).Range(m.cRange).Select
.Charts.Add
WITH .ActiveChart
.Name =fncTran('柱状图')+m.cChartName
.ChartType =54
.Elevation =45&&20
.Rotation =25 && 25
.GapDepth =0
.BarShape =m.nBarShape
.DepthPercent =500
.HeightPercent =100
.HasTitle =.T.
.HasLegend =.T.
.HasDataTable =.F.
.RightAngleAxes =.T.
.WallsAndGridLines2D =.T.
.ChartGroups(1).VaryByCategories=.T.
.Walls.ClearFormats
*.Axes(1).HasTitle =.T.
*.Axes(1).AxisTitle.Text = "指标值"
.Axes(2).HasTitle =.T.
.Axes(2).AxisTitle.Text = sycap
.Axes(2).AxisTitle.Orientation = -4166
.Axes(2).HasMajorGridLines =.T.
.Axes(2).HasMinorGridLines =.T.
WITH .ChartTitle.Characters
WITH .Font
.Size =12
.Bold =.T.
.Name ='Arial'
ENDWITH
.Text =m.cChartTitle
ENDWITH
WITH .Axes(1).TickLabels
.Orientation =-4166 &&90
.Font.Size =12
.Font.Name ='Arial'
ENDWITH
WITH .Axes(2)
.MajorGridLines.Delete
.TickLabels.Font.Size =12
.TickLabels.Font.Name ='Arial'
ENDWITH
WITH .SeriesCollection(1)
.ApplyDataLabels
WITH .DataLabels
.Orientation =30
.Font.Size =12
.Font.Name ='Arial'
.ShowValue=.F.
ENDWITH
ENDWITH
.PageSetup.CenterHeader =m.cChartTitle
ENDWITH
ENDPROC
PROCEDURE prdColumnWithDepthChart
PARAMETERS m.cRange,m.cChartName,m.nBarShape,m.cChartTitle,sxcap,sycap
.sheets("统计分析" ).Select
.sheets("统计分析" ).Range(m.cRange).Select
.Charts.Add
WITH .ActiveChart
.Name =fncTran('柱状图')+m.cChartName
.ChartType =54
.Elevation =45&&20
.Rotation =25 && 25
.GapDepth =0
.BarShape =m.nBarShape
.DepthPercent =500
.HeightPercent =100
.HasTitle =.T.
.HasLegend =.T.
.HasDataTable =.F.
.RightAngleAxes =.T.
.WallsAndGridLines2D =.T.
.ChartGroups(1).VaryByCategories=.T.
.Walls.ClearFormats
*.Axes(1).HasTitle =.T.
*.Axes(1).AxisTitle.Text = "指标值"
.Axes(2).HasTitle =.T.
.Axes(2).AxisTitle.Text = sycap
.Axes(2).AxisTitle.Orientation = -4166
.Axes(2).HasMajorGridLines =.T.
.Axes(2).HasMinorGridLines =.T.
WITH .ChartTitle.Characters
WITH .Font
.Size =12
.Bold =.T.
.Name ='Arial'
ENDWITH
.Text =m.cChartTitle
ENDWITH
WITH .Axes(1).TickLabels
.Orientation =-4166 &&90
.Font.Size =12
.Font.Name ='Arial'
ENDWITH
WITH .Axes(2)
.MajorGridLines.Delete
.TickLabels.Font.Size =12
.TickLabels.Font.Name ='Arial'
ENDWITH
WITH .SeriesCollection(1)
.ApplyDataLabels
WITH .DataLabels
.Orientation =30
.Font.Size =12
.Font.Name ='Arial'
.ShowValue=.F.
ENDWITH
ENDWITH
.PageSetup.CenterHeader =m.cChartTitle
ENDWITH
ENDPROC
#7
没看懂你要达到什么目的
如果是想要整个图表都不显示数据标签: oExcel.ActiveChart.ApplyDataLabels(-4142)
如果是想要图表的第n条折线不显示数据标签: oExcel.ActiveChart.SeriesCollection(n).HasDataLabels= .f.
如果是想要整个图表都不显示数据标签: oExcel.ActiveChart.ApplyDataLabels(-4142)
如果是想要图表的第n条折线不显示数据标签: oExcel.ActiveChart.SeriesCollection(n).HasDataLabels= .f.
#8
至于那些 xl??? 常量的值,用对象浏览器就可以得到
1. vfp 命令窗口中打开一个空的命令编辑窗口
2. 打开对象浏览器,勾选 Microsoft Excel (版本号) Object Library
3. 将对象浏览器上的 Constants 节点拖到 vfp 编辑窗口中就好了
1. vfp 命令窗口中打开一个空的命令编辑窗口
2. 打开对象浏览器,勾选 Microsoft Excel (版本号) Object Library
3. 将对象浏览器上的 Constants 节点拖到 vfp 编辑窗口中就好了
#9
老大谢谢您。
我昨天下午装了一下vs2015 刚学习,装了两个小时。
#10
服了,真服啊!
#DEFINE xlAll -4104
#DEFINE xlAutomatic -4105
#DEFINE xlBoth 1
#DEFINE xlCenter -4108
#DEFINE xlChecker 9
#DEFINE xlCircle 8
#DEFINE xlCorner 2
#DEFINE xlCrissCross 16
#DEFINE xlCross 4
#DEFINE xlDiamond 2
#DEFINE xlDistributed -4117
#DEFINE xlDoubleAccounting 5
#DEFINE xlFixedValue 1
#DEFINE xlFormats -4122
#DEFINE xlAll -4104
#DEFINE xlAutomatic -4105
#DEFINE xlBoth 1
#DEFINE xlCenter -4108
#DEFINE xlChecker 9
#DEFINE xlCircle 8
#DEFINE xlCorner 2
#DEFINE xlCrissCross 16
#DEFINE xlCross 4
#DEFINE xlDiamond 2
#DEFINE xlDistributed -4117
#DEFINE xlDoubleAccounting 5
#DEFINE xlFixedValue 1
#DEFINE xlFormats -4122
#11
如果是想要图表的第n条折线不显示数据标签: oExcel.ActiveChart.SeriesCollection(n).HasDataLabels= .f.
我要用代码控制所有不显示
For i=1 to oExcel.ActiveChart.SeriesCollection.count ????
OExcel.ActiveChart.SeriesCollection(i).HasDataLabels= .f.
next
我要用代码控制所有不显示
For i=1 to oExcel.ActiveChart.SeriesCollection.count ????
OExcel.ActiveChart.SeriesCollection(i).HasDataLabels= .f.
next
#1
oExcel.ActiveChart.Axes(2).AxisTitle.Orientation = -4166
#2
谢谢老大。只不过,您怎么知道的啊。
#3
我不信邪,也录个宏就看到了啊
#4
这个我当时看到了,xlvertical 这种常量,对应的值,我在哪儿能找到啊。
PROCEDURE prdLineChart
PARAMETERS m.cRange,m.cChartName,m.cChartTitle,sxcap,sycap
.sheets("统计分析" ).Select
.sheets("统计分析" ).Range(m.cRange).Select
.Charts.Add
WITH .ActiveChart
.Name =fncTran('折线图')+m.cChartName
.ChartType =65
.HasTitle =.T.
.HasLegend =.T.
.HasDatatable=.F. && 这个柱状图,上能控制不让图表上显示数据 为什么不起作用??????
.ApplyDataLabels
WITH .Axes(1)
*.HasTitle =.T.
*.AxisTitle.Text = "指标值"
.HasMajorGridLines =.T.
.HasMinorGridLines =.T.
WITH .TickLabels
.Orientation =-4166 &&90
.Font.Size =12
.Font.Name ='Arial'
ENDWITH
ENDWITH
WITH .Axes(2)
.HasTitle =.T.
.AxisTitle.Text = sycap
.AxisTitle.Orientation = -4166
.HasMajorGridLines =.T.
.HasMinorGridLines =.T.
.TickLabels.Font.Size =12
.TickLabels.Font.Name ='Arial'
ENDWITH
WITH .SeriesCollection(1)
WITH .Border
*.ColorIndex =7
.Weight =3
ENDWITH
WITH .DataLabels
.Border.LineStyle =-4105
.Position =0
.Font.Size =12
.Font.Name ='Arial'
*.Interior.ColorIndex =17
.Shadow =.F.
.ShowValue=.F. && 这个柱状图,上能控制不让图表上显示数据 为什么话拆线图上不起作用?
ENDWITH
.Shadow =.F.
.Smooth =.T.
ENDWITH
WITH .PlotArea
.Border.LineStyle =0
*.Interior.ColorIndex =2
ENDWITH
WITH .ChartTitle.Characters
.Text =UPPER(m.cChartName)
WITH .Font
.Size =12
.Bold =.T.
.Name ='Arial'
ENDWITH
ENDWITH
.PageSetup.CenterHeader =m.cChartTitle
ENDWITH
ENDPROC
这是我录的代码,折线图上有两条线 需要再选择中具体哪条线?
ActiveSheet.ChartObjects("图表 1").Activate
Selection.ShowValue = True
Selection.ShowSeriesName = True
Selection.ShowSeriesName = False
Selection.ShowValue = False
是不是要从这个东西下手? ActiveChart.Axes(xlCategory).MajorGridlines.Select
#5
#6
*柱图代码
PROCEDURE prdColumnWithDepthChart
PARAMETERS m.cRange,m.cChartName,m.nBarShape,m.cChartTitle,sxcap,sycap
.sheets("统计分析" ).Select
.sheets("统计分析" ).Range(m.cRange).Select
.Charts.Add
WITH .ActiveChart
.Name =fncTran('柱状图')+m.cChartName
.ChartType =54
.Elevation =45&&20
.Rotation =25 && 25
.GapDepth =0
.BarShape =m.nBarShape
.DepthPercent =500
.HeightPercent =100
.HasTitle =.T.
.HasLegend =.T.
.HasDataTable =.F.
.RightAngleAxes =.T.
.WallsAndGridLines2D =.T.
.ChartGroups(1).VaryByCategories=.T.
.Walls.ClearFormats
*.Axes(1).HasTitle =.T.
*.Axes(1).AxisTitle.Text = "指标值"
.Axes(2).HasTitle =.T.
.Axes(2).AxisTitle.Text = sycap
.Axes(2).AxisTitle.Orientation = -4166
.Axes(2).HasMajorGridLines =.T.
.Axes(2).HasMinorGridLines =.T.
WITH .ChartTitle.Characters
WITH .Font
.Size =12
.Bold =.T.
.Name ='Arial'
ENDWITH
.Text =m.cChartTitle
ENDWITH
WITH .Axes(1).TickLabels
.Orientation =-4166 &&90
.Font.Size =12
.Font.Name ='Arial'
ENDWITH
WITH .Axes(2)
.MajorGridLines.Delete
.TickLabels.Font.Size =12
.TickLabels.Font.Name ='Arial'
ENDWITH
WITH .SeriesCollection(1)
.ApplyDataLabels
WITH .DataLabels
.Orientation =30
.Font.Size =12
.Font.Name ='Arial'
.ShowValue=.F.
ENDWITH
ENDWITH
.PageSetup.CenterHeader =m.cChartTitle
ENDWITH
ENDPROC
PROCEDURE prdColumnWithDepthChart
PARAMETERS m.cRange,m.cChartName,m.nBarShape,m.cChartTitle,sxcap,sycap
.sheets("统计分析" ).Select
.sheets("统计分析" ).Range(m.cRange).Select
.Charts.Add
WITH .ActiveChart
.Name =fncTran('柱状图')+m.cChartName
.ChartType =54
.Elevation =45&&20
.Rotation =25 && 25
.GapDepth =0
.BarShape =m.nBarShape
.DepthPercent =500
.HeightPercent =100
.HasTitle =.T.
.HasLegend =.T.
.HasDataTable =.F.
.RightAngleAxes =.T.
.WallsAndGridLines2D =.T.
.ChartGroups(1).VaryByCategories=.T.
.Walls.ClearFormats
*.Axes(1).HasTitle =.T.
*.Axes(1).AxisTitle.Text = "指标值"
.Axes(2).HasTitle =.T.
.Axes(2).AxisTitle.Text = sycap
.Axes(2).AxisTitle.Orientation = -4166
.Axes(2).HasMajorGridLines =.T.
.Axes(2).HasMinorGridLines =.T.
WITH .ChartTitle.Characters
WITH .Font
.Size =12
.Bold =.T.
.Name ='Arial'
ENDWITH
.Text =m.cChartTitle
ENDWITH
WITH .Axes(1).TickLabels
.Orientation =-4166 &&90
.Font.Size =12
.Font.Name ='Arial'
ENDWITH
WITH .Axes(2)
.MajorGridLines.Delete
.TickLabels.Font.Size =12
.TickLabels.Font.Name ='Arial'
ENDWITH
WITH .SeriesCollection(1)
.ApplyDataLabels
WITH .DataLabels
.Orientation =30
.Font.Size =12
.Font.Name ='Arial'
.ShowValue=.F.
ENDWITH
ENDWITH
.PageSetup.CenterHeader =m.cChartTitle
ENDWITH
ENDPROC
#7
没看懂你要达到什么目的
如果是想要整个图表都不显示数据标签: oExcel.ActiveChart.ApplyDataLabels(-4142)
如果是想要图表的第n条折线不显示数据标签: oExcel.ActiveChart.SeriesCollection(n).HasDataLabels= .f.
如果是想要整个图表都不显示数据标签: oExcel.ActiveChart.ApplyDataLabels(-4142)
如果是想要图表的第n条折线不显示数据标签: oExcel.ActiveChart.SeriesCollection(n).HasDataLabels= .f.
#8
至于那些 xl??? 常量的值,用对象浏览器就可以得到
1. vfp 命令窗口中打开一个空的命令编辑窗口
2. 打开对象浏览器,勾选 Microsoft Excel (版本号) Object Library
3. 将对象浏览器上的 Constants 节点拖到 vfp 编辑窗口中就好了
1. vfp 命令窗口中打开一个空的命令编辑窗口
2. 打开对象浏览器,勾选 Microsoft Excel (版本号) Object Library
3. 将对象浏览器上的 Constants 节点拖到 vfp 编辑窗口中就好了
#9
老大谢谢您。
我昨天下午装了一下vs2015 刚学习,装了两个小时。
#10
服了,真服啊!
#DEFINE xlAll -4104
#DEFINE xlAutomatic -4105
#DEFINE xlBoth 1
#DEFINE xlCenter -4108
#DEFINE xlChecker 9
#DEFINE xlCircle 8
#DEFINE xlCorner 2
#DEFINE xlCrissCross 16
#DEFINE xlCross 4
#DEFINE xlDiamond 2
#DEFINE xlDistributed -4117
#DEFINE xlDoubleAccounting 5
#DEFINE xlFixedValue 1
#DEFINE xlFormats -4122
#DEFINE xlAll -4104
#DEFINE xlAutomatic -4105
#DEFINE xlBoth 1
#DEFINE xlCenter -4108
#DEFINE xlChecker 9
#DEFINE xlCircle 8
#DEFINE xlCorner 2
#DEFINE xlCrissCross 16
#DEFINE xlCross 4
#DEFINE xlDiamond 2
#DEFINE xlDistributed -4117
#DEFINE xlDoubleAccounting 5
#DEFINE xlFixedValue 1
#DEFINE xlFormats -4122
#11
如果是想要图表的第n条折线不显示数据标签: oExcel.ActiveChart.SeriesCollection(n).HasDataLabels= .f.
我要用代码控制所有不显示
For i=1 to oExcel.ActiveChart.SeriesCollection.count ????
OExcel.ActiveChart.SeriesCollection(i).HasDataLabels= .f.
next
我要用代码控制所有不显示
For i=1 to oExcel.ActiveChart.SeriesCollection.count ????
OExcel.ActiveChart.SeriesCollection(i).HasDataLabels= .f.
next