Consulting

Results 1 to 2 of 2

Thread: Nightingale Rose Diagram - how to add wedge outlines

  1. #1
    VBAX Newbie
    Joined
    Dec 2015
    Posts
    1
    Location

    Nightingale Rose Diagram - how to add wedge outlines

    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 (Nightingale-Rose-Diagram-Template_edit.xlsm). 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).
    BenefitsWheel.jpg
    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

    BenefitsWheel_error.jpg

    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

  2. #2
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    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
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •