PDA

View Full Version : [SOLVED] Chart Limitations (Plotting from Arrays)



BlueCactus
05-25-2005, 06:35 PM
The following code fragment *appears* to work/fail based on the size of the two 1D arrays, as well as their type. Am I imagining things? If not, does anyone know what the actual limits are?

.SeriesCollection.NewSeries
.SeriesCollection(.SeriesCollection.Count).XValues = arrayScale
.SeriesCollection(.SeriesCollection.Count).Values = arrayData
I've been trying to free as much of my code as possible from reliance on sheets, but this issue is really putting a wrench in the works...

MWE
05-25-2005, 07:00 PM
The following code fragment *appears* to work/fail based on the size of the two 1D arrays, as well as their type. Am I imagining things? If not, does anyone know what the actual limits are?
.SeriesCollection.NewSeries
.SeriesCollection(.SeriesCollection.Count).XValues = arrayScale
.SeriesCollection(.SeriesCollection.Count).Values = arrayData
I've been trying to free as much of my code as possible from reliance on sheets, but this issue is really putting a wrench in the works...
You are correct that this will work or fail based on the size of the arrays. Actually, it is based on the number of characters used. At something around 240 characters for XValues or Values, the method will fail. Thus if your values are essentially integers, you can have more. If the values have a few places to the right of the decimal point, you can have fewer values.

BlueCactus
05-25-2005, 07:20 PM
Grrrr!!! I suspected something like that. Typical M$. You get 16-bit rows but only 8-bit columns. And then this. Meanwhile, we all have or are craving 64-bit processors..... [/rant]

Anyway, thanks for confirming that MWE. I guess my code will just have to create and delete sheets to dump the arrays on.

MWE
05-26-2005, 07:40 AM
I am been fighting this for about a year and have done some testing to see exactly what the limits are. If you have "lots" of data, I think the temp sheet approach is best. But if you are trying to, say, double what you can do already, a few things you can do to push the envelope:
1. minimize the # of characters used. The # of decimal places can normally be reduced with little lose of utility
2. consider plotting only every "nth" point in the VBA arrays. If you are trying to just get a sense of the data, every point is not typically necessary.
3. consider plotting the data as multiple "lines" on a single axis

Good luck

BlueCactus
05-26-2005, 08:42 AM
Thanks MWE. I think the limits are just too low. I deal with hundreds to thousands of points, and I need to have every point. I occasionally hit the 256 column limit too, and originally saw this as one way of bypassing that issue. Not to be. So temp sheets are the way to go. Still more flexible than my earlier code, just not as good as I had hoped....