+ Reply to Thread
Results 1 to 5 of 5

Macro to plot multiple series line in one chart-"scatter with straight lines and markers"

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Macro to plot multiple series line in one chart-"scatter with straight lines and markers"

    Hello everyone!
    My excel sheet is arranged like this:
    COLUMN "A" : SERIES NAME- THERE ARE MORE THAN 200 SERIES
    COLUMN "B" : DATE- MULTIPLE DATES FOR EACH SERIES NAME, SHOULD BE ON X AXIS
    COLUMN "C" : DATA - DATA AGAINST EACH DATE, SHOULD BE ON Y AXIS

    PROBLEM: Need to plot one line for each series i.e. more than 200 line in one chart (Chart Type: "SCATTER WITH STRAIGHT LINES AND MARKERS")
    Please help!
    Thanks in advance.
    Attachment is not working hence putting screen shot.
    sample.JPG
    Regards
    Adarsh
    Last edited by adarshks; 09-03-2019 at 08:42 AM. Reason: SOME TYPING ERRORS

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Macro to plot multiple series line in one chart-"scatter with straight lines and marke

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    01-22-2014
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to plot multiple series line in one chart-"scatter with straight lines and marke

    I have attached my sample data file along with desired result chart.
    please tell if anything more is required.

    Adarsh
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-22-2014
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to plot multiple series line in one chart-"scatter with straight lines and marke

    Any solution friends?

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Macro to plot multiple series line in one chart-"scatter with straight lines and marke

    I might ask what you dislike about the way you created the chart, because the chart you have looks correct to me. I expect it was tedious to set up -- needing to define each series individually, but it works.

    Data in a list like this is really good for a source database, but is somewhat tedious to work with when charting. Spreadsheet charts are designed to work with data in a table where your X values are in a single column on the left of the table, your series names are in a row across the top, and the body of the table contains the values. Whatever strategy you like for rearranging the data should work just fine for this. Once you have the data rearranged, then creating the chart should be straightforward.

    Assuming you are unfamiliar with ways to rearrange the data, two possibilities come quickly to mind:

    A) A pivot table can readily rearrange data like this. Insert a pivot table with dates as the row labels, series name as the column labels, and the values in the body of the pivot table (note that this will have trouble if there are more than one entry per date/series pair -- which your example data does not show). Then, because pivot charts cannot be scatter charts, follow the tutorial here for creating a regular chart from pivot table data: https://peltiertech.com/regular-char...-pivot-tables/

    B) Something similar to this strategy for "conditional" charts: https://peltiertech.com/conditional-...-excel-charts/ where you add a row of series names (matching the values in column A) at the top of a series of helper columns, then use a simple IF() function to copy the appropriate values into the appropriate columns. Then create the scatter chart from the those helper columns.

    I am not familiar with Power Pivot or Power Query, but I would not be surprised if those utilities have tools in them for rearranging the data like this. If you have access to those utilities, you might explore what they can do.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Printing point labels for chart "scatter with straight lines"
    By scatteredlines in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-22-2017, 11:13 AM
  2. Replies: 0
    Last Post: 06-14-2017, 05:14 PM
  3. One Data Series "Invisible" on Scatter Plot, please help!
    By CristinaL in forum Excel General
    Replies: 2
    Last Post: 10-05-2014, 09:45 AM
  4. Excel Macro to Define Series Markers In Scatter Chart
    By andysweeney in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-19-2012, 05:10 AM
  5. Scatter Plot not plotting straight line for same data in x & y
    By jhooper in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-14-2011, 01:05 PM
  6. scatter plot with fitted straight line
    By eternity_forget in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2009, 07:50 AM
  7. Replies: 2
    Last Post: 10-06-2007, 01:26 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