Solved

Draw 4 arcs around circle in Excel

Posted on 2013-12-07
6
697 Views
Last Modified: 2013-12-07
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
Comment
Question by:simonwait
  • 4
6 Comments
 
LVL 81

Expert Comment

by:byundt
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

by:simonwait
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

by:byundt
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 81

Accepted Solution

by:
byundt earned 500 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

by:Saqib Husain, Syed
ID: 39703412
How about a scatter chart?
Arcs-by-scatter.xlsx
0
 
LVL 81

Expert Comment

by:byundt
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

Open in new window

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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 …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question