+ Reply to Thread
Results 1 to 7 of 7

Different length of values for X axis

  1. #1
    Registered User
    Join Date
    10-19-2017
    Location
    italy
    MS-Off Ver
    2010
    Posts
    37

    Different length of values for X axis

    Hi everyone. So, I have some very long csv files with logs every 5 secs approximately for about 2 days and I want to put them in a graph. The problem is that the X axis is a mess with all those values. Now, I can easily create a new column with values from 0 to 48 hours for example. But how can I tell Excel that it needs to show all the data point with that different range of values for the X axis?

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

    Re: Different length of values for X axis

    I am having difficulty visualizing the problem. What chart type are you using? Are the times in the text file being imported as text or as real date/time values? Can you post a sample file with the existing chart that illustrates the problems you are having and what you would like to do differently?
    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
    10-19-2017
    Location
    italy
    MS-Off Ver
    2010
    Posts
    37
    Quote Originally Posted by MrShorty View Post
    I am having difficulty visualizing the problem. What chart type are you using? Are the times in the text file being imported as text or as real date/time values? Can you post a sample file with the existing chart that illustrates the problems you are having and what you would like to do differently?
    Hi. Here is an example I've made (without real data). What I'd like is to have a graph that shows the trend in time, but I'd like the numbers from 0 to 48 on the X axis instead of the whole range, but with the entire data set correctly divided. Suggestions?
    Attached Files Attached Files

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

    Re: Different length of values for X axis

    I could not find a chart in your sample file, so I am still not sure what you have tried. If I understand what you are trying to do, I would expect to:

    1) Add a column to convert the seconds data in column A to hours =A2/3600 or =CONVERT(A2,"sec","hr")
    2) Insert a scatter chart that uses the time in hours column for the x values and the data column for the y values. If you leave the time in hours column in column C and the data in column B, then you will need to create the chart with whatever Excel guesses, then edit the data series in the Select Data dialog to get the x and y values correctly assigned.
    3) Any formatting you want to add.

    That should work, assuming I understand what you are trying to do. If I am not understanding, then please explain what you are trying and what you want different.

  5. #5
    Registered User
    Join Date
    10-19-2017
    Location
    italy
    MS-Off Ver
    2010
    Posts
    37
    Quote Originally Posted by MrShorty View Post
    I could not find a chart in your sample file, so I am still not sure what you have tried. If I understand what you are trying to do, I would expect to:

    1) Add a column to convert the seconds data in column A to hours =A2/3600 or =CONVERT(A2,"sec","hr")
    2) Insert a scatter chart that uses the time in hours column for the x values and the data column for the y values. If you leave the time in hours column in column C and the data in column B, then you will need to create the chart with whatever Excel guesses, then edit the data series in the Select Data dialog to get the x and y values correctly assigned.
    3) Any formatting you want to add.

    That should work, assuming I understand what you are trying to do. If I am not understanding, then please explain what you are trying and what you want different.

    Here's the file. The A column is seconds and goes on the X axis. I'd like that axis to be something like 0,20,40,60,80 mins and that's it, but I don't know how to properly format that axis
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-12-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Different length of values for X axis

    Hi Mikla

    I've taken your sample and added a column to round each second value to a number of minutes then used that as the axis markers and set it to a date axis rather than text, this then allows you to control how many values to include. in the attached I've set it to show every 10th value. this can be changed in the axis format for your graph

    Ron

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

    Re: Different length of values for X axis

    Is there a reason you are using a line chart? As I indicated, I would have expected to use scatter chart for this. If I open your file and simply change the chart type to scatter, I get a good seconds axis. To make an axis in minutes, then do like rondeondon did and add a column that converts seconds to minutes, then insert a scatter chart using that column as the horizontal xvalues range.

+ 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: 2
    Last Post: 12-16-2015, 06:25 AM
  2. Replies: 9
    Last Post: 09-22-2015, 02:43 AM
  3. Replies: 2
    Last Post: 03-17-2014, 07:58 AM
  4. Measuring length of x-axis in a graph
    By Yohans in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-01-2010, 01:12 AM
  5. Replies: 8
    Last Post: 02-12-2009, 10:12 AM
  6. Axis length
    By small_wonder11 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-14-2005, 11:05 PM
  7. [SOLVED] How to insert X axis scale values next to axis and X axis grid lin
    By vp23larry in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-23-2005, 11:05 AM

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