+ Reply to Thread
Results 1 to 2 of 2

Mouse over effect on autoshape

  1. #1
    Mark Stephens
    Guest

    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. #2
    Jon Peltier
    Guest

    Re: Mouse over effect on autoshape

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1