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  

How do I get 3 series in sync with the x-axis?



 
 
Thread Tools Display Modes
  #11  
Old October 25th, 2004, 01:23 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default

Nathan -

You can carry the pivot table approach further. When the pivot table source data is
changed, the dynamic range that defines the data changes. You could use a
WorkBook_Change routine that detects the change and updates the pivot table.

Create a defined name that grows with the pivot table data range (Sheet1!PT_Source).
right click the Sheet1 tab, View Source from the pop up menu. This opens the
worksheet code module in the VB Editor. Choose Worksheet from the top left dropdown,
which creates the Worksheet_Change event procedure in the module. Insert a few lines
that determine whether the defined pivot table source range has changes, and if so,
updates pivot tables in other sheets:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("PT_Source")) Is Nothing Then
Worksheets("Sheet2").PivotTables("PivotTable1").Pi votCache.Refresh
Worksheets("Sheet3").PivotTables("PivotTable1").Pi votCache.Refresh
Worksheets("Sheet4").PivotTables("PivotTable1").Pi votCache.Refresh
End If
End Sub

This updates pivot tables on sheets 2, 3, and 4. Any defined names that determine
what piece of each pivot table to chart should update with the pivot tables. All the
user has to do is enable macros when the workbook first opens.

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


zizbird wrote:

My temporary solution before reading your latest post was to use a slew of
named ranges with inelegant names like 2004eoq3c2 and to add a workbook sheet
whose sole purpose was gathering totals/averages based on the actual data
sheets.

I added rows marked "Do not edit" to contain the named ranges so that the
named ranges get moved properly when rows are inserted at the edges of the
ranges.

That sounds like your suggestion for "uncomplicated data arrangements".

Since my data needs to be sorted by date for one chart and sorted by another
item for a second chart, ranged names for both sort orders would gridlock the
data: Sorted one way, inserting a row would require the redefinition of all
named ranges for sorting the other way that happened to be down-page of the
inserted row.

Removing the simpler set of named ranges and its associated chart and
re-creating that chart each time it is needed removes the gridlock, but isn't
a permanent solution.

I had begun to look at pivot tables and charts as a possible permanent
solution but found that pivot tables appear to be static data summaries,
requiring their re-creation every time new data is entered.

Excel seems to have tried very hard to make pivot tables/charts easy and
user-friendly but not easy enough for my end users who will only be able to
enter rows of data -- nothing else. Fifteen seconds for you (and probably for
me once I figure it out) is certainly quick enough but my successors won't be
able to make use of this.

Using a "dynamic range to define the pivot table source data" and refreshing
sounds good... I think I can trust them to refresh rand run a macro... if I
write a tutorial.

I'll have to learn more about these things myself first -- I'll post again
when I get any results to speak of.

Thank you very much for the help and links.

-Nathan


"Jon Peltier" wrote:


To make a long story short...

Your efforts to make the data entry system comprehensible to the user is admirable.
Of course, there's no rule that says the data entered must be plotted as is. For
uncomplicated data arrangements, simple worksheet formulas or defined names can make
the data plottable.

The data that you show is perfectly suited to analysis by pivot table.

DATE DATA SERIES_IDENTIFIER
1/1/2004 1 S1
1/3/2004 3 S1
1/4/2004 5 S1
1/7/2004 7 S1
1/1/2004 22 S2
1/5/2004 44 S2
1/7/2004 66 S2


In fifteen seconds I turned the data above into the chart-ready table below:

Sum of DATA2 SERIES_IDENTIFIER
DATE S1 S2
1/1/2004 1 22
1/3/2004 3
1/4/2004 5
1/5/2004 44
1/7/2004 7 66

If you use a dynamic range to define the pivot table source data, refreshing the
table will capture the added data. A pivot chart will update automatically when the
pivot table is updated, but cannot render a time scale axis. A regular chart will
only update the number of points in a series using named ranges for series data, but
will not add series accordingly. So you should use a regular chart, and update it
with a macro after refreshing the pivot table.

Thanks to Debra Dalgleish, there is a section on my web site that can help you get
started with pivot tables:

http://peltiertech.com/Excel/Pivots/pivotstart.htm

Debra adds to this on her own site. Look under P in the index:

http://contextures.com/tiptech.html

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




 




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
Problem with the display of a 2 axis chart Peter B Charts and Charting 1 August 4th, 2004 02:39 AM
Ineffective change of plot order in series formula Jon Peltier Charts and Charting 3 May 30th, 2004 02:15 AM
Formatting a data series to run value axis to value axis Eva Whitley Charts and Charting 2 April 29th, 2004 04:49 PM
series and axis alighnment sammi1977 Charts and Charting 1 March 8th, 2004 12:53 PM
Dual axis with Bar chart + two series : is it possible ?? lOURY Charts and Charting 3 February 20th, 2004 03:55 PM


All times are GMT +1. The time now is 04:51 PM.


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