Solved

Draw 4 arcs around circle in Excel

Posted on 2013-12-07
6
722 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
[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
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

726 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