+ Reply to Thread
Results 1 to 3 of 3

Excel Chart with one legend and independent x y data

  1. #1
    Registered User
    Join Date
    03-30-2016
    Location
    Georgia
    MS-Off Ver
    ms office 2010
    Posts
    55

    Excel Chart with one legend and independent x y data

    Hello Guys, I have some difficulties with charts and not sure even its possible to be solved but I hope you can help me to find a solution, I do know some vba as well if it will be a solution
    I have data like this
    Date X Y
    5/7/2018 2.98 2.02
    5/9/2018 2.14 2.38

    I need chart which will show points depended on X Y and show date in legend
    I am uploading picture hope you will see what I need
    Attached Images Attached Images

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

    Re: Excel Chart with one legend and independent x y data

    I see a couple of ways to approach this:

    A) If you use the built in legend, then each point must be added to the chart (can I assume it is an XY scatter chart?) as a separate data series. ASsuming an XY scatter chart:
    A1) Insert XY scatter chart with one of the points (Excel may not get it right at chart creation, but we'll fix that next).
    A2) Bring up the select data dialog (https://support.office.com/en-US/Art...f-79983125df12 ). Edit the first data series (if Excel got it wrong at chart creation) so that:
    A2a) The appropriate cell is in the Y values field.
    A2b) The appropriate cell is in the X values field.
    A2c) The appropriate date cell is in the Series name field.
    A3) Add a new series for each data point filling out the same fields for each data series. Repeat until all data points are added to the chart.
    This should be easy even if it is tedious. It can be automated with VBA, if desired, but it might take longer to write, test, and debug a VBA procedure than it takes to add the series manually one at a time.

    B) Instead of using a legend, use Data labels to attach the appropriate date to each data point.
    B1) Select entire X and Y ranges and insert XY scatter chart.
    B2) Using something like Rob Bovey's XY chart labeler add-in (pre-2013) or the native option (post-2013) add data labels to the single data series and use the dates column for the data labels. If those are true dates and not text strings, the dates may show up as serial numbers. If so, format the data labels to have an appropriate date format.

    I would be inclined to go with option B without the legend, but the final choice is up to you.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    03-30-2016
    Location
    Georgia
    MS-Off Ver
    ms office 2010
    Posts
    55

    Re: Excel Chart with one legend and independent x y data

    Thanks mate, I hadn't thought about that, wrote macro and works perfectly

+ 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. [SOLVED] Use data labels in legend with X Y scatter chart
    By CostCare in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2016, 03:10 AM
  2. Donut Chart with 2 data sets - Legend does not work
    By jasonj427 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-14-2015, 04:56 AM
  3. Using VBA to format Excel chart legend font
    By simonc2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2014, 02:28 PM
  4. Formatting a Chart Legend Key Excel 2003
    By Mogadeet in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-11-2013, 04:25 AM
  5. Legend & Line Chart data overlap - Automatic Fix?
    By jkatsalis in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-24-2013, 05:36 PM
  6. [SOLVED] Exclude one data series from scatter chart legend (but not from the chart)
    By JayUSA in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-29-2012, 05:24 PM
  7. [SOLVED] XY Chart with many curves: Independent legend entries?
    By Johannes Eble in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2005, 04:06 PM

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