Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Creating a chart with VBA

Well, I can't find any problems with the code you posted. And if you'd
applied a time scale to the line chart category axis you might have pulled
it off. Although there may also be a problem with the dates, if the XY chart
didn't recognize them as numeric.

Here are some pointers:

http://peltiertech.com/Excel/Charts/chartvba.html
http://peltiertech.com/Excel/ChartsH...ValueAxis.html

Why not dump the ranges into a worksheet and plot from these ranges. It
makes life much easier.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"IamJD" wrote in message
...
I have created a chart that I would like to display with a line graph (or
XY
Scatter). I use VBA to dynamically update the chart. I am using Excel
2000
and 2003.

The source data is stored in a user-defined variable which contains two
arrays. One is type "date" and the other is type "single".

The code will go through the spreadsheet populating the array with the
appropriate numbers.

I use the single type array for the y-values and the date type array for
the
x-values. If I leave the chart as a line graph, it plots the chart fine
with
one exception, the x-axis points are not spaced appropriately. If one
point
is on 1/1/2006 and another is at 2/1/2006 they are they same distance
apart
as if the two dates were 1/1/2006 and 6/1/2006. Basically, it doesn't
understand the difference between the dates, it just places the next one
right after the other.

I did some research and found that this is how it is for line graphs, so I
switched to XY Scatter plot as was suggested. Unfortuneately, the same
thing
happens. It's just that instead of dates on the x-axis it shows just
incrementing numbers (1, 2, 3, etc....).

I know the values in the array are correct, because I looked at it as the
code was running. I think this has something to do with assigning the
XValues property of the chart to an array, but not 100% sure.

Any help possible would be appreciated.



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
Creating a mix of column and scatter chart on one chart. Matt G[_3_] Charts and Charting in Excel 1 June 17th 09 05:25 AM
Creating Pie Chart WLMPilot Charts and Charting in Excel 3 April 23rd 09 05:20 PM
Creating a chart(? pie chart) that shows customers,dates and machi Mark M Charts and Charting in Excel 1 August 20th 08 10:19 PM
Creating a chart CraigM Charts and Charting in Excel 1 March 16th 06 12:50 PM
Creating a chart in C# Inbar Excel Programming 0 August 26th 04 08:51 PM


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

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

About Us

"It's about Microsoft Excel"