Making graph with time intervals on the x axis

Hi there,



I have a very long table (approx. 3000 rows) showing time and dates for tweets (from Twitter) made around a danish television show, which I have to transform into a graph. My question is how do I do that the smartest way with Numbers?


- I have to create a graph showing the total number of tweets made from two days before the show to two days after the show. (The show was on 4th of April. So the graph has to show the number of tweets on the 2nd, 3rd, 4th, 5th & 6th of april.). I'm thinking a bar chart. But how can I tell Numbers to put all tweets from e.g. the 2nd into a bar called "2nd" on the x axis?



- I have to create another graph showing the total number of tweets made across the day of the show. So the x axis would be in 24 hour intervals. (E.g. all the tweets from between 12.00 - 12.59 would go into a point on the x axis called "12".)



- I have to create a third graph showing the number of tweets made during the show. So the x axis would be in quarters (15 min intervals) from 20.00 - 01.00. (E.g. all the tweets from between 12.00-12.15 would go into a point called "12.00-12.15" on the x axis.)




Is there a smart way to control the time intervals on the x axis or do I really have to cound e.g. all tweets from 12.00-12-15 and then again all tweets from 12.15-12-30 etc.?



Hope this makes sense and there is a clever person out there somewhere who can tell me how to do this in a smart way 🙂





Best regards
Kristian Vestergaard

Denmark

Posted on Apr 23, 2014 5:31 AM

Reply
24 replies

Apr 23, 2014 5:39 AM in response to KristianVJensen

I would make three tables that reference the main data data. each table should manipulate the time and intervals and collect data for that time interval and would, in turn, be the source of data for one of the three charts. I do not have any data from which to make an example so you may, if you want, email me the data you have. My email is in the Biography of my profile.

Apr 23, 2014 7:22 AM in response to KristianVJensen

Kristian,


This should be pretty straightforward...


We will start with the 24-hour bins. Create a table like this:

User uploaded file

The first two rows are headers and the first column is a header. You can convert a row (or column) to a header by using the table formatter:

User uploaded file


set up the first two rows as shown above and name the table as shown.

Now lets set up the Date column.

User uploaded file

A3="4/2/2014"+$B$1×(ROW()−3)


this automatically creates bins for us to work with that are 1 day (24 hours)

Apr 23, 2014 7:57 AM in response to Wayne Contello

the Forum cut me off. So this will finish the steps:


B3=COUNTIFS(Tabel 1::E, ">="&A3, Tabel 1::E, "<"&A3+$B$1)


select B3 and fill down.


to plot the data select column B then select the bar chart from the charts menu in the tool bar.


To make the 1 hour bins duplicate the table we just finished (the 24 hour bins) then change the contents of cell B1 from "1d" to "1h":

User uploaded file

you will need to add cells to this table by selecting several rows (click, row 3, the "3" at the very left, then hold the shift key and click row 8). Now holf the option and the shift keys while repeatedly typing the down arrow to add rows until there are enough cells to cover the duration you want.


Repeat all this for the 15min bins.

Apr 23, 2014 8:20 AM in response to KristianVJensen

I realize I have a question about the show time, so I need an answer before I can respond to Wayne.


You wrote above: - I have to create a third graph showing the number of tweets made during the show. So the x axis would be in quarters (15 min intervals) from 20.00 - 01.00.


That makes it look like the show begins at 2000 on one day and finishes 5 hours later, at 0100 on the next day. Is that correct?


Jerry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Making graph with time intervals on the x axis

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.