Excel图表系列像素位置

需要:在Excel中,在图表Data Source的每个更新上,图表系列当前的一个端点应该用小圆形Shape来突出显示。

那么,是否有可能find该系列的位置细节,相应地移动圈子。

您可以使用创build(在一个模块中):

Public NameOval As String Sub CirclePt() ActiveSheet.ChartObjects("Chart 14").Activate x = Selection.Left + ActiveChart.PlotArea.Left y = Selection.Top + ActiveChart.PlotArea.Top ActiveChart.SeriesCollection(1).Points(ActiveChart.SeriesCollection(1).Points.Count).Select x = x + Selection.Left y = y + Selection.Top ActiveSheet.Shapes.AddShape(msoShapeOval, x - 30, y - 30, 60, 60).Select Selection.ShapeRange.Fill.Visible = msoFalse NameOval = Selection.Name End Sub 

并在表单中移动/更新形状的位置:

 Private Sub Worksheet_Change(ByVal Target As Range) ActiveSheet.ChartObjects("Chart 14").Activate x = Selection.Left + ActiveChart.PlotArea.Left y = Selection.Top + ActiveChart.PlotArea.Top ActiveChart.SeriesCollection(1).Points(ActiveChart.SeriesCollection(1).Points.Count).Select x = x + Selection.Left y = y + Selection.Top ActiveSheet.Shapes.Range(Array(NameOval)).Select Selection.Top = y - 30 Selection.Left = x - 30 End Sub