PDA

View Full Version : Chart use array as sourcedata



bluetide76
10-20-2008, 12:12 AM
I currently have a loop in which I output a increment of factory levels each day for the span of the runtime that the user specifies. I would like to chart these values but since the runtime can vary I need to set those values inside an array and then create a chart plotting only those array values. Is this possible? and if so how do I go about it?
To clarify, say the user inputs a runtime of 50 then each day from 1 to 50 I have it output a factory level, I would like to plot just these values. Then if the user changes their runtime to 100 the chart adjusts and plots the 100 values. Thanks

Andy Pope
10-20-2008, 12:35 AM
If the information is stored in a worksheet then you can make use of Named ranges.
http://peltiertech.com/Excel/Charts/Dynamics.html

If the chart data is held in memory you can write the static values to the data series but will be limited to how much data can be stored. The series forumla maximum length is ~1023 characters
This is an example of how the formula with static values would look.
=SERIES("x",{"a","b","c"},{1,2,3},1)

bluetide76
10-20-2008, 08:42 AM
I'm somewhat trying to go through a loop in which each day of the loop it would store a incrementing variable I have defined in the loop and put it into an array to chart off later. each day of the loop my factorylevel changes and I want to record that value in an array and then chart them all in a line chart.

Andy Pope
10-21-2008, 04:33 AM
Perhaps Jon's information on dynamic charts will help you out.
http://peltiertech.com/Excel/Charts/Dynamics.html

If you can store the values in a worksheet then you can use a dynamic named range to allow the chart to update to fit outputted data.