+ Reply to Thread
Results 1 to 15 of 15

Extraneous Dates Showing in Dynamic Scatter Chart

  1. #1
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Extraneous Dates Showing in Dynamic Scatter Chart

    Dynamic range based on entry in D21 that limits the number of days (Rows) to display.
    Chart populates extra dates on front and back and weekend/holiday dates which are not part of the values presented in A3:A17.
    I've tried UDF, Named Ranges, Direct and indirect Cell References with no success. Also tried to change the Type to Text but not available in Excel 2016 that I can find.
    Axis Boundaries Min/Max only take values or auto and no formula, cell reference or named reference are accepted.
    In the attached I'm commented out the UDF lines and the two cell references in F18 and F19. None of them worked in the desired manner and are included to demonstrate how far I've taken this.
    Sheet is presently loaded with just one set of values from column B, and the reference date range in A but still populates extraneous/unlisted date values.
    Goal is to reduce the clutter and just present the contents (dates and percentages) from the cells in the sheet each time D21 is changed.
    Attached Files Attached Files
    Last edited by mdjones2; 01-12-2024 at 12:26 AM.

  2. #2
    Forum Contributor
    Join Date
    09-03-2016
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2019
    Posts
    164

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    HI
    You must indicate the start date (as Long) and the end date in two separate cells.
    Then use this code (obtained from the macro recorder) to call from the Change event of cell D21
    Please Login or Register  to view this content.
    Last edited by Marius44; 01-12-2024 at 02:25 PM.

  3. #3
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    Thanks for the attempt - I'm guessing you didn't open the attachment and notice I'd already tried that approach and then commented it out when I discovered it didn't work.
    ' 'Output a text string to indicate the value
    '' ActiveSheet.ChartObjects("15Day").Chart.Axes(xlValue).MinimumScale = Range("F19").Value
    '' ActiveSheet.ChartObjects("15Day").Chart.Axes(xlValue).MaximumScale = Range("F3").Value
    '

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

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    I'm not sure I understand exactly what you want. If I had to guess, it sounds like you want a line chart rather than a scatter chart for this. I'm guessing this based on comments like "tried to change the Type to Text but not available in Excel 2016 that I can find." A text category horizontal axis is not a feature of a scatter chart, which requires a numeric horizontal axis. A line chart, on the other hand, is perfectly happy to accept a text/category horizontal axis. Again, I'm reading between the lines here, but I'm wondering if what you are looking for is a line chart instead of a scatter chart.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    Not sure I can make this any clearer but I'll try...
    Chart populates extra dates on front and back and weekend/holiday dates which are not part of the values presented in A3:A17 when min/max are not pushed through VBA.
    With the approach you've provided - which I've already tried - I'm still getting the weekends and holidays as blank entries on the chart (e.g. blank space above the dates)
    and I am trying to eliminate this clutter.
    The only dates which should appear are those in the chart which exclude weekends and holidays.
    All attempts have gotten me closer but nothing is removing those entries.
    Please Login or Register  to view this content.
    A variation on your approach, clears off the extraneous beginning and ending dates but does nothing to remove the internal weekends and holidays between the 15 days presented.
    The min/max become hard layers that do not use the chart dates but execute the values based on the total range between the dates provided violating the intent of just using the charts data.

    Other approaches without the defined min/max have given me results without these dates but I then end up with the min / max undefined and there are blank dates added before and after the dates in the data.

    Bottom line, I just want the specific dates which will be a maximum of 15 events but can be less depending on the value in D54.
    To also clarify, Line/Scatter/Bar it doesn't matter, I'm still getting garbage blank entries.
    Last edited by mdjones2; 01-22-2024 at 10:48 PM.

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

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    I don't have access to Excel, so I cannot test. Again, assuming I'm understanding correctly, I would expect to:

    1) Change chart type from scatter to line.
    2) Format horizontal axis to be text (not date).
    3) If necessary, use dynamic named ranges for the chart ranges to avoid extra "blank" categories when the table is not filled.

    It sounds like you have tried many different things. Have you tried that combination?

  7. #7
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    Yes, I've tried this method. It actually worked to eliminate the internal weekend/holiday events but left the min/max with two extra entries that were empty.
    The goal of eliminating all blank entries is where things are falling apart.
    If you were to gain access to google sheets, you'd be able to see the named ranges though not the macro's.
    All of my testing has been applied in there, but without the macro's you'll be hampered on observational testing.
    The macro was included in a previous posting but previous testing and commented out lines are included here:
    Please Login or Register  to view this content.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    You might get more traction in the VBA section - shall I move the thread for you?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    AliGW, thanks for taking a look. I'm new here so I'll take any advice from those with more info.
    Moving it does sound like it will provide more potential solutions.
    Thanks.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    I've moved it. You don't need to go anywhere else - just continue here.

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

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    I guess I would have to see what you have tried to see why you are getting blank entries. I also think, before worrying about programming anything different (whether in VBA or however we choose to interact with the spreadsheet/chart), we need to understand exactly what settings and such we need to apply to the chart.

    I just don't understand how you are getting blank categories, and your sample file (which uses a scatter chart) doesn't show me how you are arriving at blank categories. With two edits ( (1) change chart type from scatter to line and (2) change axis type from automatic to text), I get this chart. Note that there are no blank categories to the left, right, or in the middle.

    At this point, I cannot see where your blank categories are coming from, so I'm not sure what edits to suggest for your code (though I might not be the best to suggest edits, since I almost never interact with Excel charts through VBA). I'm hopeful that, once we understand where your extra categories are coming from, the VBA edits will become obvious.
    Attached Images Attached Images

  12. #12
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    That last point is exactly my issue, I can't figure out where these extraneous datapoints are coming from. They are not dates in the range but are appearing on the table between other dates.
    Establishing a contiguous date layout with the missing dates plugged in. Almost like the max/min are the controlling points and all other data is extraneous.
    The scatter chart is only being used to demonstrate clear visuals of the blank dates (weekends and holidays) that appear in the chart from the data.
    I have tried to move to Line, and Bar vice Scatter with the same issues presented - essentially streatching the datapoints (when more than two are persented.
    This is where it will demonstrate unbalanced points across the horizontal axis. When the dates are presented on the chart, it shows the entries as weekend/holidays with no data.
    Also, it looks like when the thread was moved to the VBA channel, the attachments were dropped. I've updated the chart to a line and reuploaded to give you the points being made - Notice
    that even though 1/6 and 1/7 are not in the data, they are plotted.
    Attached Images Attached Images
    Attached Files Attached Files

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

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    When I opened your file, the first thing I did was check the chart type and axis type. I see that you are using a line chart and that the axis is set to auto detect the chart type (and Excel has chosen a date axis for you). If I click on the button next to "Text" to force the axis to be a text/category axis, the extra dates disappear.

    If I haven't adequately emphasized it, you must tell Excel that you want a text axis when formatting the horizontal axis in order to prevent Excel from using a date axis that will show "extra" dates.

  14. #14
    Registered User
    Join Date
    03-08-2020
    Location
    West Coast USA
    MS-Off Ver
    O365
    Posts
    7

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    Thanks for trying. You haven't read the rest of the posts - this has already been addressed - with failure.
    That is why I'm reaching out - this approach drops the dates before and after quite well but does nothing for the dates in between (e.g. weekends and holidays) which are not included in the list of dates.

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

    Re: Extraneous Dates Showing in Dynamic Scatter Chart

    I've reread through everything, and I'm not sure what I'm missing or how my suggestion to use a line chart with a text axis fails to address the existence of extra dates. In both of your sample files, if I change the chart type to line (in the file in post #1) and change the axis type to text (in both files), the chart doesn't show the extra dates. If that is not working for you, then I must be misunderstanding something.

    Can you upload a sample file where the chart type is line and the axis type is text that is showing the extra dates? At this point, I'm not sure how much more I can help until I understand the problem, which appears to mean that I need to see an example of a line chart with a text axis displaying extra dates.

+ 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. Dynamic Scatter Plot Chart Picture
    By RuKeBo in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 12-17-2020, 05:24 PM
  2. XY Scatter with dynamic dates
    By vhawk12 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-29-2018, 05:03 PM
  3. Replies: 2
    Last Post: 02-13-2014, 06:18 AM
  4. scatter chart showing data outside of range
    By hansaaa in forum Excel Charting & Pivots
    Replies: 11
    Last Post: 04-30-2013, 02:57 PM
  5. Dynamic Range for Chart scatter plot
    By dpk1 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 04-30-2013, 03:29 AM
  6. Scatter chart/ correlation between 2 dates
    By ruangeld in forum Excel General
    Replies: 1
    Last Post: 07-07-2012, 10:02 AM
  7. Values from Hidden Column not showing in scatter chart
    By dshilan in forum Excel General
    Replies: 2
    Last Post: 06-17-2010, 10:46 AM

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