A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Pop-up" charts activated on hover



 
 
Thread Tools Display Modes
  #1  
Old August 24th, 2004, 11:20 PM
external usenet poster
 
Posts: n/a
Default "Pop-up" charts activated on hover

I'd like to have charts pop up when the user hovers over the source
data.

For instance, I have several sections of sales data in this form:

Jan Feb Mar Q1 Apr May ...

US
Target 5 6 ...
Actual 6 5
Forecast 5.5 5

Europe
Target 4 5 ...
Actual 4 5
Forecast 5 6

So, when the user hovers over the US or Europe "sections," which would
be the label row plus three following rows (tgt, act, fcst), a chart
of the data pops up to illustrate the numbers. I don't want to take
up room permanently displaying the charts, but want them accessible.

All help appreciated.

Michael Lambert

  #5  
Old August 25th, 2004, 05:13 PM
Tushar Mehta
external usenet poster
 
Posts: n/a
Default

Here's a solution that is close but does not rely on the mouse
position. Insted it requires that you click in a cell in the region of
interest.

Create the charts corresponding to the different regions. Shift+click
each to select the chartobject container (the selection rectangle
around the chart should have circles at the corners rather than black
filled squares) and name it (click in the name box at the extreme left
of the formula bar and start typing) with the name of the geographic
region (usa, europe, etc.)

Create named ranges with Insert | Name Define... Select the range
that contains the data for each region and give it the *same* name as
that of the corresponding chartobject. [Note that you cannot use the
name box for this process since XL will select the named chartobject
rather than create a name for the range.]

Put the following code in a standard module:
Option Explicit
Public AutomateCharts As Boolean
Sub showAllCharts()
Dim I As Integer
AutomateCharts = False
With ActiveSheet.ChartObjects
For I = 1 To .Count
.Item(I).Visible = True
Next I
End With
End Sub
Sub startAutomateCharts()
AutomateCharts = True
End Sub

Put the following code in the ThisWorkbook module:
Option Explicit

Private Sub Workbook_SheetSelectionChange( _
ByVal Sh As Object, ByVal Target As Range)
Dim I As Integer
If Not AutomateCharts Then Exit Sub '
With Sh.ChartObjects
For I = 1 To .Count
.Item(I).Visible = False
Next I
End With
With Sh.Parent.Names
For I = 1 To .Count
If Intersect(Target, Sh.Range(.Item(I).RefersTo)) _
Is Nothing Then
Else
Sh.ChartObjects(.Item(I).Name).Visible = True
Exit For
End If
Next I
End With
End Sub

Once you run the startAutomateCharts procedure, a chart will pop up
when you click any cell in a specified region. So, click any cell in
the range named europe and the chart named europe will become visible.

Run the showAllCharts procedure to make all charts visible and to stop
the automation effect. This will be the only way to edit a chart.

Note that there is no code in the above procedures to protect against
developer/user/data errors...

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I'd like to have charts pop up when the user hovers over the source
data.

For instance, I have several sections of sales data in this form:

Jan Feb Mar Q1 Apr May ...

US
Target 5 6 ...
Actual 6 5
Forecast 5.5 5

Europe
Target 4 5 ...
Actual 4 5
Forecast 5 6

So, when the user hovers over the US or Europe "sections," which would
be the label row plus three following rows (tgt, act, fcst), a chart
of the data pops up to illustrate the numbers. I don't want to take
up room permanently displaying the charts, but want them accessible.

All help appreciated.

Michael Lambert


  #6  
Old August 29th, 2004, 02:24 PM
Ed Ferrero
external usenet poster
 
Posts: n/a
Default

Hi Michael,

A similar solution to that proposed by Tushar Mehta can be found at
http://edferrero.m6.net/Content/ChartSelector.zip

This uses the sheet selection change event, but takes the approach
of changing the chart series rather than changing the visibility
of many pre-determined charts.

Ed Ferrero
http://edferrero.m6.net

wrote in message
om...
I'd like to have charts pop up when the user hovers over the source
data.

For instance, I have several sections of sales data in this form:

Jan Feb Mar Q1 Apr May ...

US
Target 5 6 ...
Actual 6 5
Forecast 5.5 5

Europe
Target 4 5 ...
Actual 4 5
Forecast 5 6

So, when the user hovers over the US or Europe "sections," which would
be the label row plus three following rows (tgt, act, fcst), a chart
of the data pops up to illustrate the numbers. I don't want to take
up room permanently displaying the charts, but want them accessible.

All help appreciated.

Michael Lambert



 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Make Pie Charts the Same Size Jon Peltier Charts and Charting 0 May 3rd, 2004 09:34 PM
Distribute dynamically charts with linked data as stand-alone charts Richard Charts and Charting 2 March 31st, 2004 05:16 PM
charts inadvertly resized Hammer_757 Charts and Charting 0 March 24th, 2004 03:16 AM
printing multiple charts per page Pablo Charts and Charting 1 February 27th, 2004 06:37 PM
Creating a large number of charts automatically (repost) Francine Kubaka Charts and Charting 0 September 21st, 2003 09:16 PM


All times are GMT +1. The time now is 10:57 AM.


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