+ Reply to Thread
Results 1 to 10 of 10

Creating a graph over time

  1. #1
    Registered User
    Join Date
    02-06-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Creating a graph over time

    Hi i have alot of values that i would like to display in a graph over time.

    The problem is, is that there are many different times (irregular intervals) that the value is recorded during each day.

    whenever i create a graph and choose the x-axis format as the date i get a spike at each day, which is no good!


    value Date Date Time
    0 22/12/2008 12:33:35 22/12/2008 12:33:35
    0 22/12/2008 20:53:25 20:53:25
    9 23/12/2008 00:48:48 23/12/2008 00:48:48
    0 23/12/2008 06:58:28 06:58:28
    8 23/12/2008 07:46:28 07:46:28
    0 23/12/2008 07:48:28 07:48:28
    0 23/12/2008 10:14:49 10:14:49
    0 24/12/2008 02:05:50 24/12/2008 02:05:50
    7 24/12/2008 02:22:26 02:22:26
    1 24/12/2008 04:28:46 04:28:46
    0 24/12/2008 04:30:46 04:30:46
    0 24/12/2008 20:53:21 20:53:21
    0 26/12/2008 20:57:15 26/12/2008 20:57:15
    2 29/12/2008 03:15:02 29/12/2008 03:15:02
    0 29/12/2008 03:17:02 03:17:02
    6 29/12/2008 05:23:02 05:23:02


    The best option i have so far is using columns C and D from above for the x-axis... this works exactly how i want, the only problem is i have too much data for the xaxis to be readable.

    So what i really want is maybe dates along the x-axis and when i hold the mouse over the graph it will say the time??

    Any Ideas??

    Cheers
    Last edited by VBA Noob; 02-13-2009 at 09:36 AM.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Creating a graph over time

    What if you redefine the interval spacing on the x-axis?

    CC

  3. #3
    Registered User
    Join Date
    02-06-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Creating a graph over time

    Hi charlie, when i try to redefine the intervals.. formate axis--> scale the boxes are grayed out?

    this is only works for me when i change the date format to a number...

    you have any other ideas?

    cheers

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Creating a graph over time

    Hi Samantha,

    This is expected, if you think about the way Excel deals with information: if you say "these are numbers, please divide them into intervals of 15" that makes sense, but "these are words, divide them into intervals"... what is 15 more than "tree"?

    So basically, Excel needs to know that the data are numbers (dates are numbers, so this is OK); this means the program can cope with dividing them up for you. If you want to make these numbers look like dates to you and me you must then apply a format to these numbers (i.e. goes on top of the numbers to effect a certain look).

    If you post your work, I might be able to help, I will discuss the steps I take so you can see how it works.

    HTH

  5. #5
    Registered User
    Join Date
    02-06-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Creating a graph over time

    Hi charlie, here is an example of the graph and the problems caused by having so much data (see attachement)

    Graph.JPG

    The only way i can read the time and dates is if i strech the graph.

    as this makes the overall size/shape of the graph difficult to see i would like to avoid this!

    so ideally i would like to remove the time values and keep the date, but its important to keep the shape of the graph as it is...

    here is the same graph when i remove the times...
    date.JPG

    hope this makes more sense

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Creating a graph over time

    Hi Samantha,

    I think I understand the issue, what I would like is a copy of your workbook (not a picture...) so I can show you a solution.

    CC

  7. #7
    Registered User
    Join Date
    02-06-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Creating a graph over time

    oh Sorry
    here you go...

    sample.xls

    its just a sample of the data


    cheers

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Creating a graph over time

    Ok,

    As discussed, dates are numbers and in order to do anything numeric with them (summarise, ranges etc.) Excel needs to treat them as numbers. That means we need an x-y graph, not a line graph.

    Because of the way times and dates are handled we don't need to separate the time from the date, so we only need two columns to build the graph.

    Then all we need to do is define the scale and number format of the axis. Right click on x-axis:
    Scale tab: the maximum and minimum should already be defined (make sure there is a tick in the box by them). Then - as I think you wanted a daily breakdown I changed the major unit to 1 (a day). To have weekly intervals, you would need a major unit of 7; decrease the minimum by integers if you want to define a specific start date for the axis - perhaps a Monday (39797?).
    Numebr tab: I used a custom number format of dd mmm

    I think this is now what you want

    HTH
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-06-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Creating a graph over time

    Thats exactly it!

    Thanks so much for your help, much apreciated!

  10. #10
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Creating a graph over time

    That's great, please mark the thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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