+ Reply to Thread
Results 1 to 5 of 5

Automatically scale X axis of a chart as new data is added?

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    Santa Ana, CA USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Automatically scale X axis of a chart as new data is added?

    Hello. I have a platform that gathers data from devices via RS232 (force gauge, thermocouple, etc.) and dumps it into a spreadsheet over time. In each case time is the horizontal axis (the y axis I hope, I always confuse the two) of the chart/graph and the incoming values from the sensor are the vertical axis.

    Creating a line graph out of the force vs. time or temperature vs. time after the test is complete is easy. However, I would like to create a chart/graph that will automatically scale the y axis (time) as new x values stream in. Since tests can last anywhere from 5 minutes to 24 hours, choosing a fixed number of rows isn't really practical as I would like the operator to see changes in the curve as it's happening.

    Any direction would be greatly appreciated.
    Last edited by smaier69; 11-07-2015 at 10:10 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Automatically scale Y axis of a chart as new data is added?

    Have you considered setting that axis to auto?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Automatically scale Y axis of a chart as new data is added?

    The Y axis is the one that goes up - I think you mean that you want the X axis to accommodate new data as it is added.

    It's difficult to know exactly what to suggest without seeing your workbook and how your data is laid out, but I think you will need to use a dynamic named range for those X and Y values, so that if you only have 10 then 10 points will be plotted, and if you have 100 then 100 will be plotted.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-27-2012
    Location
    Santa Ana, CA USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Automatically scale Y axis of a chart as new data is added?

    Thank you for the quick replies, guys. I have attached an example of the workbook. The charts were generated manually after the test was completed (not an issue) by manually selecting the data ranges. What I am trying to do is, regardless of how long the test has been running, have the entire x axis occupied and each time a new value is added (values are dropped in the first available cell in their respective column) in either the Temperature or Force columns (VBA inserts the time stamp automatically when a new Force value is added), the chart re-scales the x axis.

    My apologies, I know I am terrible at articulating my goal sometimes.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-27-2012
    Location
    Santa Ana, CA USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Automatically scale X axis of a chart as new data is added?

    Essentially solved.

    Used a scatter rather than a line graph.

    I should be horsewhipped with a soggy noodle.

+ 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: 10
    Last Post: 07-21-2014, 11:11 AM
  2. How to automatically add new added row data to my chart PlotArea?
    By ScubaGuy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2013, 03:22 PM
  3. Replies: 3
    Last Post: 03-28-2011, 04:15 AM
  4. How to update chart automatically as new data added?
    By hmgrts in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-01-2009, 10:28 AM
  5. chart scale from actual Y axis data
    By robert111 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-12-2008, 09:41 AM
  6. Automatically Set Min and Max Scale for Axis
    By Aussie1497 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-14-2005, 03:51 PM
  7. How do I scale the axis of a chart from external data so that dis.
    By statherdunn in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-10-2005, 02: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