PC Review


Reply
Thread Tools Rate Thread

Charts with Time as X-Axis

 
 
Ed
Guest
Posts: n/a
 
      17th Jun 2009
I would like to plot some stock prices for a stock during one day. In other
words, the X-axis will contain a series all with the same date but with
different times during the day, and the Y-axis will contain the prices.
However, it appears the smallest increment for either Line charts or Stock
charts is only one day (i.e. it plots all of my X-axis data as if it were one
point since it is all in the same day). Is there a way around this?
--
Ed
 
Reply With Quote
 
 
 
 
Ed
Guest
Posts: n/a
 
      17th Jun 2009
Incidentally, I'm using Excel 2007.

That's exactly what I've done. My X-axis series contains e.g. 6/3/2009
7:30:00 AM, 6/3/2009 7:30:30 AM, 6/3/2009 7:31:00 AM, etc. The first column
on the spreadsheet contains this time data, and the second column contains
the price. I highlight the two columns and click Insert->Line->2D Line, and
a chart comes up with only one point on the X-Axis labeled '6/3/2009 0:00'
(and a straight vertical line on the graph covering the price range). When I
highlight the X-axis on the chart, right-click, and click Format Axis, 'Major
unit' and 'Minor unit' are defaulted to 'Auto' (where it gives only one point
on the X-axis). If I click on Fixed, it only allows for Days, Months, or
Years, but not e.g. seconds.
--
Ed


"Joel" wrote:

> You x-axis has to contain a day and time to get smaller divisions. Make one
> column in your source data contain both the data and time in the same cell
> like
> 6/17/09 09:00. the graph will match the same time division and the source
> data.
>
> "Ed" wrote:
>
> > I would like to plot some stock prices for a stock during one day. In other
> > words, the X-axis will contain a series all with the same date but with
> > different times during the day, and the Y-axis will contain the prices.
> > However, it appears the smallest increment for either Line charts or Stock
> > charts is only one day (i.e. it plots all of my X-axis data as if it were one
> > point since it is all in the same day). Is there a way around this?
> > --
> > Ed

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      17th Jun 2009
Try scatter plot instead of line plot.

"Ed" wrote:

> Incidentally, I'm using Excel 2007.
>
> That's exactly what I've done. My X-axis series contains e.g. 6/3/2009
> 7:30:00 AM, 6/3/2009 7:30:30 AM, 6/3/2009 7:31:00 AM, etc. The first column
> on the spreadsheet contains this time data, and the second column contains
> the price. I highlight the two columns and click Insert->Line->2D Line, and
> a chart comes up with only one point on the X-Axis labeled '6/3/2009 0:00'
> (and a straight vertical line on the graph covering the price range). When I
> highlight the X-axis on the chart, right-click, and click Format Axis, 'Major
> unit' and 'Minor unit' are defaulted to 'Auto' (where it gives only one point
> on the X-axis). If I click on Fixed, it only allows for Days, Months, or
> Years, but not e.g. seconds.
> --
> Ed
>
>
> "Joel" wrote:
>
> > You x-axis has to contain a day and time to get smaller divisions. Make one
> > column in your source data contain both the data and time in the same cell
> > like
> > 6/17/09 09:00. the graph will match the same time division and the source
> > data.
> >
> > "Ed" wrote:
> >
> > > I would like to plot some stock prices for a stock during one day. In other
> > > words, the X-axis will contain a series all with the same date but with
> > > different times during the day, and the Y-axis will contain the prices.
> > > However, it appears the smallest increment for either Line charts or Stock
> > > charts is only one day (i.e. it plots all of my X-axis data as if it were one
> > > point since it is all in the same day). Is there a way around this?
> > > --
> > > Ed

 
Reply With Quote
 
EricG
Guest
Posts: n/a
 
      17th Jun 2009
You have to use a Scatter chart, not a Line chart. You should then get what
you want. And you can change the format of the cells to just show the time
if you want. You don't have to show the date also.

HTH,

Eric


"Ed" wrote:

> Incidentally, I'm using Excel 2007.
>
> That's exactly what I've done. My X-axis series contains e.g. 6/3/2009
> 7:30:00 AM, 6/3/2009 7:30:30 AM, 6/3/2009 7:31:00 AM, etc. The first column
> on the spreadsheet contains this time data, and the second column contains
> the price. I highlight the two columns and click Insert->Line->2D Line, and
> a chart comes up with only one point on the X-Axis labeled '6/3/2009 0:00'
> (and a straight vertical line on the graph covering the price range). When I
> highlight the X-axis on the chart, right-click, and click Format Axis, 'Major
> unit' and 'Minor unit' are defaulted to 'Auto' (where it gives only one point
> on the X-axis). If I click on Fixed, it only allows for Days, Months, or
> Years, but not e.g. seconds.
> --
> Ed
>
>
> "Joel" wrote:
>
> > You x-axis has to contain a day and time to get smaller divisions. Make one
> > column in your source data contain both the data and time in the same cell
> > like
> > 6/17/09 09:00. the graph will match the same time division and the source
> > data.
> >
> > "Ed" wrote:
> >
> > > I would like to plot some stock prices for a stock during one day. In other
> > > words, the X-axis will contain a series all with the same date but with
> > > different times during the day, and the Y-axis will contain the prices.
> > > However, it appears the smallest increment for either Line charts or Stock
> > > charts is only one day (i.e. it plots all of my X-axis data as if it were one
> > > point since it is all in the same day). Is there a way around this?
> > > --
> > > Ed

 
Reply With Quote
 
Ed
Guest
Posts: n/a
 
      17th Jun 2009
That sort of works. In some cases, it looks like there are more than one
data point for the same time. My guess is because there are so many time
data points (every 30 seconds for several hours) that when the chart
compresses it, it looks like two points at the same time, esp. if I use a
Scatter with Smooth Lines.

It would be most handy if I could play a Line chart or Stock chart with
seconds or minutes on the X-axis, but apparently this is not available.
--
Ed


"EricG" wrote:

> You have to use a Scatter chart, not a Line chart. You should then get what
> you want. And you can change the format of the cells to just show the time
> if you want. You don't have to show the date also.
>
> HTH,
>
> Eric
>
>
> "Ed" wrote:
>
> > Incidentally, I'm using Excel 2007.
> >
> > That's exactly what I've done. My X-axis series contains e.g. 6/3/2009
> > 7:30:00 AM, 6/3/2009 7:30:30 AM, 6/3/2009 7:31:00 AM, etc. The first column
> > on the spreadsheet contains this time data, and the second column contains
> > the price. I highlight the two columns and click Insert->Line->2D Line, and
> > a chart comes up with only one point on the X-Axis labeled '6/3/2009 0:00'
> > (and a straight vertical line on the graph covering the price range). When I
> > highlight the X-axis on the chart, right-click, and click Format Axis, 'Major
> > unit' and 'Minor unit' are defaulted to 'Auto' (where it gives only one point
> > on the X-axis). If I click on Fixed, it only allows for Days, Months, or
> > Years, but not e.g. seconds.
> > --
> > Ed
> >
> >
> > "Joel" wrote:
> >
> > > You x-axis has to contain a day and time to get smaller divisions. Make one
> > > column in your source data contain both the data and time in the same cell
> > > like
> > > 6/17/09 09:00. the graph will match the same time division and the source
> > > data.
> > >
> > > "Ed" wrote:
> > >
> > > > I would like to plot some stock prices for a stock during one day. In other
> > > > words, the X-axis will contain a series all with the same date but with
> > > > different times during the day, and the Y-axis will contain the prices.
> > > > However, it appears the smallest increment for either Line charts or Stock
> > > > charts is only one day (i.e. it plots all of my X-axis data as if it were one
> > > > point since it is all in the same day). Is there a way around this?
> > > > --
> > > > Ed

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      18th Jun 2009
Try reformat the axis. Click on the x-axis to select the axis. then double
click on the axis. I box will appear that allows reformating of the axis.
If the box doesn't appear try a couple of times. It is a little tricky in
getting the format box to appear.

"Ed" wrote:

> That sort of works. In some cases, it looks like there are more than one
> data point for the same time. My guess is because there are so many time
> data points (every 30 seconds for several hours) that when the chart
> compresses it, it looks like two points at the same time, esp. if I use a
> Scatter with Smooth Lines.
>
> It would be most handy if I could play a Line chart or Stock chart with
> seconds or minutes on the X-axis, but apparently this is not available.
> --
> Ed
>
>
> "EricG" wrote:
>
> > You have to use a Scatter chart, not a Line chart. You should then get what
> > you want. And you can change the format of the cells to just show the time
> > if you want. You don't have to show the date also.
> >
> > HTH,
> >
> > Eric
> >
> >
> > "Ed" wrote:
> >
> > > Incidentally, I'm using Excel 2007.
> > >
> > > That's exactly what I've done. My X-axis series contains e.g. 6/3/2009
> > > 7:30:00 AM, 6/3/2009 7:30:30 AM, 6/3/2009 7:31:00 AM, etc. The first column
> > > on the spreadsheet contains this time data, and the second column contains
> > > the price. I highlight the two columns and click Insert->Line->2D Line, and
> > > a chart comes up with only one point on the X-Axis labeled '6/3/2009 0:00'
> > > (and a straight vertical line on the graph covering the price range). When I
> > > highlight the X-axis on the chart, right-click, and click Format Axis, 'Major
> > > unit' and 'Minor unit' are defaulted to 'Auto' (where it gives only one point
> > > on the X-axis). If I click on Fixed, it only allows for Days, Months, or
> > > Years, but not e.g. seconds.
> > > --
> > > Ed
> > >
> > >
> > > "Joel" wrote:
> > >
> > > > You x-axis has to contain a day and time to get smaller divisions. Make one
> > > > column in your source data contain both the data and time in the same cell
> > > > like
> > > > 6/17/09 09:00. the graph will match the same time division and the source
> > > > data.
> > > >
> > > > "Ed" wrote:
> > > >
> > > > > I would like to plot some stock prices for a stock during one day. In other
> > > > > words, the X-axis will contain a series all with the same date but with
> > > > > different times during the day, and the Y-axis will contain the prices.
> > > > > However, it appears the smallest increment for either Line charts or Stock
> > > > > charts is only one day (i.e. it plots all of my X-axis data as if it were one
> > > > > point since it is all in the same day). Is there a way around this?
> > > > > --
> > > > > Ed

 
Reply With Quote
 
EricG
Guest
Posts: n/a
 
      18th Jun 2009
Since it's a scatter chart, you can actually have two y-values for the same
x-value. And yes, if your data is very dense compared to the axis scale, it
will look like the points are on top of each other.

If you want to run a line through the data that might improve the
appearance, try adding a trendline, using a moving average. Play with the
number of points in the average until you get something you like.

You could always try to simulate a Stock chart with the Scatter chart, but
it would probably involve some behind-the-scenes VBA help and might get
ugly...

Eric

"Ed" wrote:

> That sort of works. In some cases, it looks like there are more than one
> data point for the same time. My guess is because there are so many time
> data points (every 30 seconds for several hours) that when the chart
> compresses it, it looks like two points at the same time, esp. if I use a
> Scatter with Smooth Lines.
>
> It would be most handy if I could play a Line chart or Stock chart with
> seconds or minutes on the X-axis, but apparently this is not available.
> --
> Ed
>
>
> "EricG" wrote:
>
> > You have to use a Scatter chart, not a Line chart. You should then get what
> > you want. And you can change the format of the cells to just show the time
> > if you want. You don't have to show the date also.
> >
> > HTH,
> >
> > Eric
> >
> >
> > "Ed" wrote:
> >
> > > Incidentally, I'm using Excel 2007.
> > >
> > > That's exactly what I've done. My X-axis series contains e.g. 6/3/2009
> > > 7:30:00 AM, 6/3/2009 7:30:30 AM, 6/3/2009 7:31:00 AM, etc. The first column
> > > on the spreadsheet contains this time data, and the second column contains
> > > the price. I highlight the two columns and click Insert->Line->2D Line, and
> > > a chart comes up with only one point on the X-Axis labeled '6/3/2009 0:00'
> > > (and a straight vertical line on the graph covering the price range). When I
> > > highlight the X-axis on the chart, right-click, and click Format Axis, 'Major
> > > unit' and 'Minor unit' are defaulted to 'Auto' (where it gives only one point
> > > on the X-axis). If I click on Fixed, it only allows for Days, Months, or
> > > Years, but not e.g. seconds.
> > > --
> > > Ed
> > >
> > >
> > > "Joel" wrote:
> > >
> > > > You x-axis has to contain a day and time to get smaller divisions. Make one
> > > > column in your source data contain both the data and time in the same cell
> > > > like
> > > > 6/17/09 09:00. the graph will match the same time division and the source
> > > > data.
> > > >
> > > > "Ed" wrote:
> > > >
> > > > > I would like to plot some stock prices for a stock during one day. In other
> > > > > words, the X-axis will contain a series all with the same date but with
> > > > > different times during the day, and the Y-axis will contain the prices.
> > > > > However, it appears the smallest increment for either Line charts or Stock
> > > > > charts is only one day (i.e. it plots all of my X-axis data as if it were one
> > > > > point since it is all in the same day). Is there a way around this?
> > > > > --
> > > > > Ed

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Charts with Time as X-Axis Joel Microsoft Excel Programming 0 17th Jun 2009 09:12 PM
Time Scales on Horizontal Axis - Excel Charts SusieQ Microsoft Excel Charting 1 13th Dec 2008 11:27 AM
Excel 2003- Charts- date and time format on x-axis of XY chart =?Utf-8?B?RWxpemFiZXRo?= Microsoft Excel Charting 3 4th Oct 2007 12:08 AM
Excel Charts - Time line for random points on X axis =?Utf-8?B?QW5qYWxpa2EgU2lsdmE=?= Microsoft Excel Worksheet Functions 2 10th Jan 2006 09:22 PM
bar charts with time-spaced x-axis? joandsp Microsoft Excel Charting 1 21st Aug 2003 11:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:06 AM.