PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting Re: Make a chart spin???

Reply

Re: Make a chart spin???

 
Thread Tools Rate Thread
Old 10-07-2008, 08:39 PM   #1
Jon Peltier
Guest
 
Posts: n/a
Default Re: Make a chart spin???


I hope you're talking about a pie chart, because other types are not
intended to spin. In the pie chart, you have a property called Angle of
First Slice. To make the chart seem to spin, you need code that increments
this angle from zero to 360, then starts again at zero.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
news:Y92dnQm8orNG1-vVnZ2dnUVZ_qLinZ2d@comcast.com...
>I know I've seen some code somewhere that made a chart spin continuously.
>Does anyone know how to do this?
>
> Thanks.
>
> --
> Matthew.Wells
> Matthew.Wells@FirstByte.net
>
>



  Reply With Quote
Old 11-07-2008, 02:46 AM   #2
Jon Peltier
Guest
 
Posts: n/a
Default Re: Make a chart spin???

You rotated an Excel chart? An embedded chart object? Or a picture of a
chart?

What is the purpose of rotating the chart?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
news:1qudnYjozfST9uvVnZ2dnUVZ_rrinZ2d@comcast.com...
> Any kind. I did this in school in '99. You iterate in a loop rotating 10
> degrees at a time. I did it in VB (I'm assuming you could do it in VBA as
> well). Does anyone know the code?
>
>
> "Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
> news:uTVyjSs4IHA.1952@TK2MSFTNGP03.phx.gbl...
>>I hope you're talking about a pie chart, because other types are not
>>intended to spin. In the pie chart, you have a property called Angle of
>>First Slice. To make the chart seem to spin, you need code that increments
>>this angle from zero to 360, then starts again at zero.
>>
>> - Jon
>> -------
>> Jon Peltier, Microsoft Excel MVP
>> Tutorials and Custom Solutions
>> Peltier Technical Services, Inc. - http://PeltierTech.com
>> _______
>>
>>
>> "Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
>> news:Y92dnQm8orNG1-vVnZ2dnUVZ_qLinZ2d@comcast.com...
>>>I know I've seen some code somewhere that made a chart spin continuously.
>>>Does anyone know how to do this?
>>>
>>> Thanks.
>>>
>>> --
>>> Matthew.Wells
>>> Matthew.Wells@FirstByte.net
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 11-07-2008, 08:35 AM   #3
Andy Pope
Guest
 
Posts: n/a
Default Re: Make a chart spin???

Hi,

I guess you could rotate a 3d surface plot.

'----------
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/07/2008 by Andy Pope
'
Dim lngLoop As Long
Dim lngDelay As Long
'
With ActiveSheet.ChartObjects("Chart 1").Chart
For lngLoop = 1 To 360
.Rotation = lngLoop
DoEvents
For lngDelay = 1 To 5000
'CRUDE DELAY
Next
Next
End With

End Sub
'-----------

My 3d scatter rotates by using formula to adjust the data values. Some
simple code would allow for continual rotation.
http://www.andypope.info/charts/3drotate.htm

Although not really charts my clocks workbook demonstrates how to animate
charts.
http://www.andypope.info/fun/clocks.htm

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
news:uQlYBgv4IHA.2060@TK2MSFTNGP02.phx.gbl...
> You rotated an Excel chart? An embedded chart object? Or a picture of a
> chart?
>
> What is the purpose of rotating the chart?
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. - http://PeltierTech.com
> _______
>
>
> "Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
> news:1qudnYjozfST9uvVnZ2dnUVZ_rrinZ2d@comcast.com...
>> Any kind. I did this in school in '99. You iterate in a loop rotating
>> 10 degrees at a time. I did it in VB (I'm assuming you could do it in
>> VBA as well). Does anyone know the code?
>>
>>
>> "Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
>> news:uTVyjSs4IHA.1952@TK2MSFTNGP03.phx.gbl...
>>>I hope you're talking about a pie chart, because other types are not
>>>intended to spin. In the pie chart, you have a property called Angle of
>>>First Slice. To make the chart seem to spin, you need code that
>>>increments this angle from zero to 360, then starts again at zero.
>>>
>>> - Jon
>>> -------
>>> Jon Peltier, Microsoft Excel MVP
>>> Tutorials and Custom Solutions
>>> Peltier Technical Services, Inc. - http://PeltierTech.com
>>> _______
>>>
>>>
>>> "Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
>>> news:Y92dnQm8orNG1-vVnZ2dnUVZ_qLinZ2d@comcast.com...
>>>>I know I've seen some code somewhere that made a chart spin
>>>>continuously. Does anyone know how to do this?
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Matthew.Wells
>>>> Matthew.Wells@FirstByte.net
>>>>
>>>>
>>>
>>>

>>
>>

>
>


  Reply With Quote
Old 13-07-2008, 11:42 AM   #4
Andy Pope
Guest
 
Posts: n/a
Default Re: Make a chart spin???

So what exactly did not work with the code I posted?

Matthew Wells wrote:
> Let me start over. This is only for a "wow" effect. Obviously you can
> manually rotate any 3d graph by grabbing the handle and moving it. What I
> want is code that overall will take an access query result of maybe 5 rows,
> 3 cols, create an Excel workbook, open it up, paste the query results in a
> worksheet, create a 3d graph, and then in VBA start a loop that will call
> the rotate method of the graph to give it the effect. Like I said, I've
> done this before back in school with vb6 in not too much code. I can do
> most of this already, I only need the rotating loop.
>
> Does anyone know this?
>
> Thanks.
>
>
> "Andy Pope" <andy@andypope.info> wrote in message
> news:BE32B61F-416B-4B99-9645-0A32B6E18FF3@microsoft.com...
>
>>Hi,
>>
>>I guess you could rotate a 3d surface plot.
>>
>>'----------
>>Sub Macro1()
>>'
>>' Macro1 Macro
>>' Macro recorded 11/07/2008 by Andy Pope
>>'
>> Dim lngLoop As Long
>> Dim lngDelay As Long
>>'
>> With ActiveSheet.ChartObjects("Chart 1").Chart
>> For lngLoop = 1 To 360
>> .Rotation = lngLoop
>> DoEvents
>> For lngDelay = 1 To 5000
>> 'CRUDE DELAY
>> Next
>> Next
>> End With
>>
>>End Sub
>>'-----------
>>
>>My 3d scatter rotates by using formula to adjust the data values. Some
>>simple code would allow for continual rotation.
>>http://www.andypope.info/charts/3drotate.htm
>>
>>Although not really charts my clocks workbook demonstrates how to animate
>>charts.
>>http://www.andypope.info/fun/clocks.htm
>>
>>Cheers
>>Andy
>>
>>--
>>
>>Andy Pope, Microsoft MVP - Excel
>>http://www.andypope.info
>>"Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
>>news:uQlYBgv4IHA.2060@TK2MSFTNGP02.phx.gbl...
>>
>>>You rotated an Excel chart? An embedded chart object? Or a picture of a
>>>chart?
>>>
>>>What is the purpose of rotating the chart?
>>>
>>>- Jon
>>>-------
>>>Jon Peltier, Microsoft Excel MVP
>>>Tutorials and Custom Solutions
>>>Peltier Technical Services, Inc. - http://PeltierTech.com
>>>_______
>>>
>>>
>>>"Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
>>>news:1qudnYjozfST9uvVnZ2dnUVZ_rrinZ2d@comcast.com...
>>>
>>>>Any kind. I did this in school in '99. You iterate in a loop rotating
>>>>10 degrees at a time. I did it in VB (I'm assuming you could do it in
>>>>VBA as well). Does anyone know the code?
>>>>
>>>>
>>>>"Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
>>>>news:uTVyjSs4IHA.1952@TK2MSFTNGP03.phx.gbl...
>>>>
>>>>>I hope you're talking about a pie chart, because other types are not
>>>>>intended to spin. In the pie chart, you have a property called Angle of
>>>>>First Slice. To make the chart seem to spin, you need code that
>>>>>increments this angle from zero to 360, then starts again at zero.
>>>>>
>>>>>- Jon
>>>>>-------
>>>>>Jon Peltier, Microsoft Excel MVP
>>>>>Tutorials and Custom Solutions
>>>>>Peltier Technical Services, Inc. - http://PeltierTech.com
>>>>>_______
>>>>>
>>>>>
>>>>>"Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
>>>>>news:Y92dnQm8orNG1-vVnZ2dnUVZ_qLinZ2d@comcast.com...
>>>>>
>>>>>>I know I've seen some code somewhere that made a chart spin
>>>>>>continuously. Does anyone know how to do this?
>>>>>>
>>>>>>Thanks.
>>>>>>
>>>>>>--
>>>>>>Matthew.Wells
>>>>>>Matthew.Wells@FirstByte.net
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>

>
>


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  Reply With Quote
Old 13-07-2008, 04:49 PM   #5
Jon Peltier
Guest
 
Posts: n/a
Default Re: Make a chart spin???

You need the code to rotate the chart, right? Can you do it manually? If so
(and I'm sure it's so), turn on the macro recorder while you rotate the
chart. Rotate the chart, approve the rotation and clear the dialog, then
repeat a couple times, while the recorder is running. Then see what the
recorded code uses to rotate the chart, and implement this into your
procedure.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
news:AY2dnSnTiKQwdOXVnZ2dnUVZ_tbinZ2d@comcast.com...
> Let me start over. This is only for a "wow" effect. Obviously you can
> manually rotate any 3d graph by grabbing the handle and moving it. What I
> want is code that overall will take an access query result of maybe 5
> rows, 3 cols, create an Excel workbook, open it up, paste the query
> results in a worksheet, create a 3d graph, and then in VBA start a loop
> that will call the rotate method of the graph to give it the effect. Like
> I said, I've done this before back in school with vb6 in not too much
> code. I can do most of this already, I only need the rotating loop.
>
> Does anyone know this?
>
> Thanks.
>
>
> "Andy Pope" <andy@andypope.info> wrote in message
> news:BE32B61F-416B-4B99-9645-0A32B6E18FF3@microsoft.com...
>> Hi,
>>
>> I guess you could rotate a 3d surface plot.
>>
>> '----------
>> Sub Macro1()
>> '
>> ' Macro1 Macro
>> ' Macro recorded 11/07/2008 by Andy Pope
>> '
>> Dim lngLoop As Long
>> Dim lngDelay As Long
>> '
>> With ActiveSheet.ChartObjects("Chart 1").Chart
>> For lngLoop = 1 To 360
>> .Rotation = lngLoop
>> DoEvents
>> For lngDelay = 1 To 5000
>> 'CRUDE DELAY
>> Next
>> Next
>> End With
>>
>> End Sub
>> '-----------
>>
>> My 3d scatter rotates by using formula to adjust the data values. Some
>> simple code would allow for continual rotation.
>> http://www.andypope.info/charts/3drotate.htm
>>
>> Although not really charts my clocks workbook demonstrates how to animate
>> charts.
>> http://www.andypope.info/fun/clocks.htm
>>
>> Cheers
>> Andy
>>
>> --
>>
>> Andy Pope, Microsoft MVP - Excel
>> http://www.andypope.info
>> "Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
>> news:uQlYBgv4IHA.2060@TK2MSFTNGP02.phx.gbl...
>>> You rotated an Excel chart? An embedded chart object? Or a picture of a
>>> chart?
>>>
>>> What is the purpose of rotating the chart?
>>>
>>> - Jon
>>> -------
>>> Jon Peltier, Microsoft Excel MVP
>>> Tutorials and Custom Solutions
>>> Peltier Technical Services, Inc. - http://PeltierTech.com
>>> _______
>>>
>>>
>>> "Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
>>> news:1qudnYjozfST9uvVnZ2dnUVZ_rrinZ2d@comcast.com...
>>>> Any kind. I did this in school in '99. You iterate in a loop rotating
>>>> 10 degrees at a time. I did it in VB (I'm assuming you could do it in
>>>> VBA as well). Does anyone know the code?
>>>>
>>>>
>>>> "Jon Peltier" <jonxlmvpNO@SPAMpeltiertech.com> wrote in message
>>>> news:uTVyjSs4IHA.1952@TK2MSFTNGP03.phx.gbl...
>>>>>I hope you're talking about a pie chart, because other types are not
>>>>>intended to spin. In the pie chart, you have a property called Angle of
>>>>>First Slice. To make the chart seem to spin, you need code that
>>>>>increments this angle from zero to 360, then starts again at zero.
>>>>>
>>>>> - Jon
>>>>> -------
>>>>> Jon Peltier, Microsoft Excel MVP
>>>>> Tutorials and Custom Solutions
>>>>> Peltier Technical Services, Inc. - http://PeltierTech.com
>>>>> _______
>>>>>
>>>>>
>>>>> "Matthew Wells" <Matthew.Wells@FirstByte.net> wrote in message
>>>>> news:Y92dnQm8orNG1-vVnZ2dnUVZ_qLinZ2d@comcast.com...
>>>>>>I know I've seen some code somewhere that made a chart spin
>>>>>>continuously. Does anyone know how to do this?
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> --
>>>>>> Matthew.Wells
>>>>>> Matthew.Wells@FirstByte.net
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off