Solved

Defining the five parameters in a Chart Series Shadow

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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