你们知道excel2007如何为散点图设置标签吗?不少人想学习一下,来看看excel2007为散点图设置标签的方法吧,希望对大家有所帮助。
excel2007为散点图设置标签方法:
散点图设置标签步骤1:打开数据集,选择数值型数据,插入“散点图”,即获得该数据集的图形。

散点图设置标签步骤2:Excel直接获得的散点图比较展示效果不太理想,需要自己手动做一些调整。选择水平坐标轴,邮件,选择“设置坐标轴格式”,将坐标轴选项的最小值调整为1.5,最大值调整为2.0。同样的对纵轴也进行同样的设置,效果见下图。



散点图设置标签步骤3:由于Excel不能直接添加标签,我们需要自己编写宏来完成这个过程。因为这里有供参考的添加气泡图系列文本标签,我们首先将图表类型更改为气泡图。

散点图设置标签步骤4:按“Alt+F11“键,打开VBA编辑器。
散点图设置标签步骤5:输入下列代码:
Sub AddLabel()
\'为气泡图数据系列添加文本数据标签\'
Dim rRng As Range
Dim i As Integer
On Error GoTo line1
Set rRng = Application.InputBox("选择包含数据标签的列区域", Title:="选择区域", Type:=8)
Selection.ApplyDataLabels
For i = 1 To rRng.Rows.Count
Selection.Points(i).DataLabel.Text = rRng.Item(i).Text
Next i
line1:
End Sub
散点图设置标签步骤6:代码输入完后,点击运行按钮,出现”选择包含数据标签的列区域“提示框。


散点图设置标签步骤7:在提示框内选择文本数据值,点击确定,

散点图设置标签步骤8:这时,再将数据类型更改为散点图。点击确定。完成。


以上就是excel2007为散点图设置标签的方法,希望可以帮助到大家。