Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mark Stephens
 
Posts: n/a
Default Mouse over effect on autoshape

The line chart hilite effect is really great (especially on a black
bacground, thanks Andy ). http://www.pdbook.com/index.php/excel/comment/635/

Does anyone know how one would modify it so that you for example have an
autoshape the same colour as the line on the chart and when you mouse
over it it lights up (hilites, it really is a great effect) the line on the
chart?

The other effect I would really love to achieve is a similar effect with the
pie chart where when you mouse over a slice, it's border hilites in the same
way as the line on the line chart.

Thanks again, kind regards, Mark



  #2   Report Post  
Jon Peltier
 
Posts: n/a
Default

Mark -

In the first chart, name the shapes "shpSeries1", "shpSeries2" etc. This is the
framework for the code you want:

Private Sub Chart_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal x As
Long, ByVal y As Long)
Dim ElementID As Long, Arg1 As Long, Arg2 As Long

GetChartElement x, y, ElementID, Arg1, Arg2

Application.StatusBar = ElementID & ", " & Arg1 & ", " & Arg2

If ElementID = xlShape Then
If Left(ActiveChart.Shapes(Arg1).Name, 9) = "shpSeries" Then
With ActiveChart.SeriesCollection _
(CLng(Mid(ActiveChart.Shapes(Arg1).Name, 10)))

' change color etc.

End With
End If

End If

End Sub


For the pie chart, you are changing the border formatting. Andy's effect that
changes the data in a second line chart series so it now appears won't work with the
pie, but my approach that changes the connecting line format can be modified. Record
a macro while you change the formatting of a pie slice to see the syntax.

Note that you need to know which point you are mousing over, so you need to use Arg2
(point number) as well as Arg1 (series number).

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

Mark Stephens wrote:

The line chart hilite effect is really great (especially on a black
bacground, thanks Andy ). http://www.pdbook.com/index.php/excel/comment/635/

Does anyone know how one would modify it so that you for example have an
autoshape the same colour as the line on the chart and when you mouse
over it it lights up (hilites, it really is a great effect) the line on the
chart?

The other effect I would really love to achieve is a similar effect with the
pie chart where when you mouse over a slice, it's border hilites in the same
way as the line on the line chart.

Thanks again, kind regards, Mark




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create shadow effect on with chart [email protected] Charts and Charting in Excel 1 April 21st 05 10:24 PM
Mouse continues to select after clicking on a cell in excel. Fletch Excel Discussion (Misc queries) 4 February 22nd 05 02:27 AM
moving mouse highlights cells without touching left mouse button bremboy Excel Discussion (Misc queries) 2 January 27th 05 06:19 PM
moving mouse lighlights cells brentb Excel Discussion (Misc queries) 1 January 17th 05 06:36 PM
moving mouse highlights cells. why? brentb Excel Discussion (Misc queries) 1 January 17th 05 05:34 PM


All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"