+ Reply to Thread
Results 1 to 3 of 3

Combine Series data from multiple Charts into one Chart

  1. #1
    Registered User
    Join Date
    06-22-2016
    Location
    Canberra, Australia
    MS-Off Ver
    Professional Plus 2010
    Posts
    4

    Combine Series data from multiple Charts into one Chart

    Hi,

    I have been able to write the following VBA code to loop through the data in my spread sheet and add each Series to a separate Chart.


    Please Login or Register  to view this content.
    What I would like to do now is instead of creating a separate Chart for each series, I would like all Series to be added to the same Chart (as they all have the same X Value range).

    The data I have is in the following format:

    Please Login or Register  to view this content.
    In this file if Column 3 = "0" this is a header Row where by:
    Please Login or Register  to view this content.
    The rest of the Rows are the data:
    Please Login or Register  to view this content.
    Also, an example data file is attached (example_data.txt).

    Please let me know if you have any suggestions on how to create one chart with all the series added to it.

    Thank you
    Attached Files Attached Files
    Last edited by jgoodz; 06-28-2016 at 12:51 AM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,910

    Re: Combine Series data from multiple Charts into one Chart

    And where you have a zero in column 3 is the beginning of a new series?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,910

    Re: Combine Series data from multiple Charts into one Chart

    I imported the data into an Excel table.

    This solution makes use of a pivot table to get the unique list of Locations. The pivot table is in Column F. There’s a helper column next to the pivot table that gets the row number for where the location is found, and how many items are in that location. These are used to make named dynamic ranges.

    There are two subroutines that make the chart.

    MakeNames removes the old named ranges (those starting with “Series”) and makes new ones.

    AddSeries removes the old series from the chart and adds new ones.

    The naming convention for the created names is critical.

    Also the code is fragile. It has hard coding for where the pivot table is, and what the chart name is.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 09-18-2013, 10:13 AM
  2. How can I use VBA to create multiple pie charts from a series of data
    By johnskinner 3 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-26-2012, 01:52 PM
  3. How to Combine Charts Or Create A Chart From Multiple Rows/Columns
    By teg3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2011, 08:15 AM
  4. Macro needed for multiple series of data to plot unique charts
    By ehelliar in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 04-23-2011, 11:50 AM
  5. Combine side-by-side data series with 3D column chart
    By isburns in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-04-2009, 04:15 AM
  6. Replies: 0
    Last Post: 12-09-2008, 08:42 PM
  7. Charts Line Types for Multiple Data Series not Printing Properly
    By Seanb in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-22-2005, 02:05 PM

Tags for this Thread

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