Solved

Defining the five parameters in a Chart Series Shadow

Posted on 2013-05-30
3
1,213 Views
Last Modified: 2013-05-31
I have a code that will create a shadow on all the series collections in my chart, but the only parameter I can control is blur. I'm looking to get the first shadow preset which has the settings below. (More or less. Blur = 4 pt didn't work but Blur = 25 did)

So what would be the proper syntax to perfectly emulate the Excel 2007 default shadow preset?

   For i = 4 To 8
   Nm = Cells(i, 1).Value
   ActiveChart.SeriesCollection(Nm).Format.Shadow.Visible = msoTrue
   ActiveChart.SeriesCollection(Nm).Format.Shadow.Blur = 25   '4 pt
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Transparency = 60
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Size = 100
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Angle = 45 (w/ degrees symbol)
   'ActiveChart.SeriesCollection(Nm).Format.Shadow.Distance = 3 pt
   Next i

Open in new window

Thanks!
John
0
Comment
Question by:gabrielPennyback
3 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 39209983
Pls try

With a little help from Pythagoras:  .OffsetX and OffsetY = 2.1213203436 with a distance of 3 and an angle of 45°.
The hypothenuse is 3, that means X and Y are ((3^2)/2)^0.5= 2.1213203436

    With Selection.Format.Shadow
        .Visible = msoTrue
        .Blur = 4
        .OffsetX = 2.1213203436
        .OffsetY = 2.1213203436
        .RotateWithShape = msoFalse
        .Transparency = 0.6 ' for 60 Pct
        .Size = 100
    End With

Open in new window

Regards
0
 
LVL 17

Assisted Solution

by:andrewssd3
andrewssd3 earned 250 total points
ID: 39210072
You can directly assign the shadow presets using e.g.
s.Format.Shadow.Type = msoShadow22

Open in new window

(where 's' is the chart series). Not sure exactly what preset it is you want, but you can experiment with the different constants
0
 
LVL 1

Author Closing Comment

by:gabrielPennyback
ID: 39211595
Awesome answers! Thanks   - John
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 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 Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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…

911 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

27 Experts available now in Live!

Get 1:1 Help Now