Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default Line chart - time series - category axis date format (2007 VBA)

I'm using VBA in Excel 2007 to plot time series as line charts (i.e., data on
Y axis, dates on X axis, ChartType = xlLineMarkers). My data's not in a neat
"block", so I can't use the ChartWizard or SetSourceData methods. For Y-axis
data I'm using:

With ActiveChart
..SeriesCollection.Add Source:= [a range variable with my data]

How do I set up the X-Axis so that I can format the dates? I've tried:
..Axes(xlCategory).CategoryType = xlTimeScale
..Axes(xlCategory).CategoryNames = [a range variable which is a column of
dates]

However, Excel treats the CategoryNames as strings. CategoryType appears to
be ignored.

Anyone know what I'm doing wrong?
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Line chart - time series - category axis date format (2007 VBA)

Make sure that all of the cells which look like dates to you are real
numeric dates. It only takes on to be entered as text for Excel to ignore
the time scale setting.

Another point, though you have some kind of routine to use data from diverse
locations, Excel is more reliable when charting from orderly ranges. You
should either bring the data together, or set up another range which links
to the data wherever it is.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Paul Jacob" <Paul wrote in message
...
I'm using VBA in Excel 2007 to plot time series as line charts (i.e., data
on
Y axis, dates on X axis, ChartType = xlLineMarkers). My data's not in a
neat
"block", so I can't use the ChartWizard or SetSourceData methods. For
Y-axis
data I'm using:

With ActiveChart
.SeriesCollection.Add Source:= [a range variable with my data]

How do I set up the X-Axis so that I can format the dates? I've tried:
.Axes(xlCategory).CategoryType = xlTimeScale
.Axes(xlCategory).CategoryNames = [a range variable which is a column of
dates]

However, Excel treats the CategoryNames as strings. CategoryType appears
to
be ignored.

Anyone know what I'm doing wrong?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 line chart automatic category axis text rotation Boris Charts and Charting in Excel 2 December 4th 08 11:56 PM
Excel 2003- Charts- date and time format on x-axis of XY chart Elizabeth Charts and Charting in Excel 3 October 4th 07 12:08 AM
Time Series Chart Data Plot Line ''Disappears'' When Y Axis Formating Is Changed John Burke Charts and Charting in Excel 8 July 30th 07 03:10 PM
TO CREATE A LINE CHART WITH RATE IN Y AXIS & REAL TIME IN X AXIS vijaicbe Charts and Charting in Excel 4 November 9th 06 10:16 AM
can I make the vertical axis the category axis in Excel line graph power1 Charts and Charting in Excel 1 March 20th 06 08:45 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"