PDA

View Full Version : Nightingale Rose Diagram - how to add wedge outlines



SarahW
12-14-2015, 07:13 AM
Hi,

I've not used VBA before. I downloaded an Excel template for a nightingale rose diagram and have managed to tweak it for my needs (14978). However, I want to add thin black outlines for each of the wedges that extend out to the edges of the diagram, despite their actual value (like the image below).
14976
I presume I need to repeat the 'For' command, like the one at the start of the code, but just change the scale height to a value that equates to the edge of the outer circle and make the fill colour transparent. However, I tried inserting the code below after the first 'For' code block (after 'End With') but it all goes completely wrong (see image). I presume it is something to do with the object names but am now completely out of my depth! Any ideas? Thanks

14977

For i = 1 To MaxCol j = 17
Do While Cells(j, i) <> ""

Set ObjShape = ActiveSheet.Shapes.AddShape(msoShapePie, 400, 700, 150, 150)
.LockAspectRatio = msoTrue
.Fill.Visible = msoFalse
.Line.ForeColor.RGB = RGB(255, 0, 0)
.Line.Weight = 1
.Line.Visible = msoTrue
.Adjustments.Item(2) = 360 / MaxCol - 90
.Adjustments.Item(1) = -90
.Rotation = 360 / MaxCol * (i - 1)
.ScaleHeight 1.25, msoFalse, msoScaleFromTopLeft
For k = 1 To j - 1
.ZOrder msoSendtoBack
Next
End With
MyShapes(n) = ObjShape.Name

n = n + 1
j = j + 1
Loop
Next
n = n - 1

Leith Ross
12-14-2015, 09:05 PM
Hello SarahW,

Here is a link to a site that has VBA code for 2 types of Nightingale's Rose or Polar Diagrams. These are not identical to your's but should help.

Nightingale's Rose Diagram Excel Template (http://www.excelhowto.com/nightingale-rose-diagram-excel-template/)