Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Defining the five parameters in a Chart Series Shadow

Posted on 2013-05-30
3
Medium Priority
?
1,288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 1000 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 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

704 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