Solved

Draw 4 arcs around circle in Excel

Posted on 2013-12-07
6
688 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 80

Expert Comment

by:byundt
Comment Utility
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
Comment Utility
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 80

Expert Comment

by:byundt
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
Comment Utility
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
Comment Utility
How about a scatter chart?
Arcs-by-scatter.xlsx
0
 
LVL 80

Expert Comment

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now