PDA

View Full Version : Chart scaling and adjusting



bluetide76
09-30-2008, 08:07 PM
I have a line chart that plots data from 4 columns. First column is data points while the other 3 are control limits which are the same value for all data points making a straight line.
My conflict is that I have the chart set to go up to 100 data point entries, but there is the possibility that it may only have 20 at first. I made if statements in those cells to give N/a in order to dodge it plotting those data points that would be blank cells. But it still counts the number of iterations which is 100 points. So I was able to get my Y value points to limit correctly based on the data input, but how do I tell the chart not to graph the X values if they are v/a?
To explain it more clear say I have this below
5 8 7 9
3 8 7 9
N/a N/a N/a N/a
The graph will plot the points 5 and 3 and the lines at 7 8 9 but wont enter any Y value for N/a. This is what I wanted. But for the X axis it would show 4 entries and the data series stops at 3. How do I make it cut off as well?

Also how can I make a sub to rescale my chart based on my data sizes?

lucas
09-30-2008, 08:53 PM
Is the N/a you refer to an error returned by a formula? If so, look up iserror in help.




Also how can I make a sub to rescale my chart based on my data sizes?


See if this addresses your dynamic chart area problem (http://vbaexpress.com/kb/getarticle.php?kb_id=602)

bluetide76
09-30-2008, 09:07 PM
It is an error that I created. I have an IF(ISNUMBER function that checks if there are vales on another sheet, if so it does an average of those, if not it NA(). This makes it where when I plot my data it ignores those NA() values and plots a continuous line graph. My problem is it still acts like there are 100 x-axis points. Even though these xvalues are just increments of 1-100. While the actual data points could only be like 25 or any number pending user input. I'm trying to tell the graph to only plot the data points with values that are there in that range of columns.