Solved

Defining the five parameters in a Chart Series Shadow

Posted on 2013-05-30
3
1,197 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 48

Accepted Solution

by:
Rgonzo1971 earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Awesome answers! Thanks   - John
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
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.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

771 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

11 Experts available now in Live!

Get 1:1 Help Now