VBA绕圆弧

问题描述 投票:1回答:1

对于我们的一份报告,我试图将圆弧定位在一个圆上以显示客户表现的范围。

到目前为止,sub确实建立了一个与内圆大小相同的圆弧,但是我无法以某种方式正确定位它。

有人有线索吗?

我在下面附上图片来演示我的问题!

保持安全

 firstang = shp.Chart.ChartGroups(1).FirstSliceAngle
    radius = shp.Chart.PlotArea.Height / 2
    Pi = 3.14159265358979
z = 1
j = 1
Debug.Print "Charttype: " & shp.Chart.ChartType

gradfaktor = (360 / Pi)
Breite = shp.Chart.PlotArea.Width + 2 * Abstand + 2 * Balkendicke
breitekreissegment = Balkendicke / Breite * 2
For z = 1 To shp.Chart.SeriesCollection(1).Points.Count
    Set newshp = sld.Shapes.AddShape(msoShapeBlockArc, 10, 10, Breite, Breite)

x1 = shp.Chart.SeriesCollection(1).Points(z).PieSliceLocation(xlHorizontalCoordinate, xlOuterClockwisePoint)
y1 = shp.Chart.SeriesCollection(1).Points(z).PieSliceLocation(xlVerticalCoordinate, xlOuterClockwisePoint)

x2 = shp.Chart.SeriesCollection(1).Points(z).PieSliceLocation(xlHorizontalCoordinate, xlOuterCounterClockwisePoint)
y2 = shp.Chart.SeriesCollection(1).Points(z).PieSliceLocation(xlVerticalCoordinate, xlOuterCounterClockwisePoint)

                                                                      newshp.Fill.ForeColor.RGB = farbe
  newshp.Line.Transparency = 1
  newshp.name = "B1_" & 1

  DoEvents
   'newshp.Height = shp.Height

  DoEvents

  newshp.Left = shp.Left + shp.Chart.PlotArea.Left * 0.5 - Balkendicke 
  newshp.Top = shp.Top + shp.Chart.PlotArea.Top * 0.5 - Balkendicke 




 newshp.Adjustments.Item(3) = breitekreissegment


  l1 = ((x2 - x1) ^ 2 + (y2 - y1) ^ 2) ^ 0.5
  alpha1 = (2 * ArcSin((l1 / (2 * radius)))) * 180 / Pi


          newshp.Adjustments.Item(1) = alpha1
          newshp.Adjustments.Item(2) = firstang
DoEvents

  firstang = firstang + alpha1 + WinkelAbstand

Next z

chartcount = chartcount + 1









l1 = ((x2 - x1) ^ 2 + (y2 - y1) ^ 2) ^ 0.5

alpha1 = (2 * ArcSin((l1 / (2 * radius)))) * 180 / Pi

enter image description here

vba geometry automatic-ref-counting powerpoint-vba
1个回答
0
投票

您可以执行类似的操作,只需制作单独的图形即可。

© www.soinside.com 2019 - 2024. All rights reserved.