[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
Solved

# Draw 4 arcs around circle in Excel

Posted on 2013-12-07
Medium Priority
738 Views
Hi Im trying to do something Im not sure is possible.  I have 8 cells which have a value of between 0 & 360 degrees.  the values in cells 1 & 2 are paired, 3 & 4 are paired, 5 & 6, etc..

The idea I am trying to look into is to take the values in the cells of a pair and plot them on a circle with a coloured line between them.  I would then take the next pair and add them to the circle and so on.

Is this possible?  If its best in VBA Im not adverse to that!

Many thanks

Simon
0
Question by:simonwait
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 4

LVL 81

Expert Comment

ID: 39703286
Simon,
Would a pie chart do what you need?

I assumed that each pair of values comprised the starting and ending angle for the arc segment. I also assumed that the arc segments were non-overlapping.

Using those assumptions, I put the angles in cells A2:A9, with 360 in cell A10. I then put the following formula in cell F2 and copied it down.
=A2-SUM(F1)

I plotted the values from column F in a pie chart. Every other segment I colored white. These represent the "gaps" between the arcs.

I then made the plot area have a transparent fill (so you can see the gridlines behind it), with no border. I deleted the white blocks from the legend (left-click it twice to select just that point in the legend, then delete).
Arcmaster-Q28312965.xlsm
0

LVL 1

Author Comment

ID: 39703301
It could work if there was a way to only colour the outer edge of the pie.  Im trying to graphically represent objects which rotate around this circle so I think a pie image is a little confusing but certainly moving in the right direction!
0

LVL 81

Expert Comment

ID: 39703327
I changed the chart to a donut chart, then made the "hole" be 90% of the OD. This gives a nice thick arc segment.
Arcmaster-Q28312965.xlsm
0

LVL 81

Accepted Solution

byundt earned 2000 total points
ID: 39703339
Perhaps better yet, I changed the white fill for the "gaps" to a medium gray, then made the borders use an Automatic color. I also made the border width 0, which decreased the size of the white gaps between arc segments. The gray color completes the circle, and the automatic line color makes them disappear.
Arcmaster-Q28312965.xlsm
0

LVL 43

Expert Comment

ID: 39703412
Arcs-by-scatter.xlsx
0

LVL 81

Expert Comment

ID: 39703681
Here is a macro that will draw four arcs of a specified radius at a specified location. Each arc will have a different color.

As written, the starting and ending angular positions of each arc segment are listed in ordered pairs in cells A2:A9. The arc segments are initially placed at cell N20, though they are subsequently rotated and stretched.
``````Sub ArcMaker()
Dim shp As Shape
Dim i As Long
Dim OD As Single
Dim rg As Range, targ As Range
Set rg = Worksheets(1).Range("A2:A9")   'Angle beginnings and ends as ordered pairs
Set targ = Worksheets(1).Range("N20")   'Draw circle here
OD = 36 'Diameter of circle (pixels)
For i = 1 To rg.Cells.Count Step 2
Set shp = ActiveSheet.Shapes.AddShape(msoShapeArc, targ.Left, targ.Top, 36, 36)
With shp
.Adjustments.Item(2) = rg.Cells(i + 1, 1).Value - rg.Cells(i, 1).Value - 90
.Line.ForeColor.ObjectThemeColor = i
.Line.Weight = 5
.Rotation = rg.Cells(i, 1).Value
End With
Next
End Sub
``````
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
###### Suggested Courses
Course of the Month13 days, 11 hours left to enroll