My posts often contain charts where the data for the series is generated on the fly, but not in worksheet cells. Rather they are generated from named formulas. The technique deserves some explanation.
I put together a Lissajous Curve Explorer and Gallery to demonstrate how this works. Lissajous curves make a good subject matter for this demonstration because minute changes in their parameterized variables can produce an infinite variation as the output.
Each plot in the Explorer contains 4,000 data points. Using named formulas to generate the data saves us the hassle and tedium of maintaining 8,000 cells of chart data (4,000 for x and 4,000 for y). Many of my projects contain dozens of series for a chart. In fact the Optical Illusions #4 had nearly the maximum of 255 series in the chart. So you can see how the number of cells to drive a chart could really add up. This technique avoids all of that.
What I do is create a named formula, n, to represent the number of points I want (this can be a constant or a formula).
The next step is to create a named formula, t:
=(ROW(INDIRECT("1!1:"&n+1))-1)*2*PI()/nIn the Lissajous Curve Explorer, we are going to feed the trig function SIN so our t needs to vary between zero and 2π. This produces, in this case, 4,000 equally spaced values for t. Using ROW/INDIRECT is the same technique that we use in normal array formulas in worksheets to produce a loop - remember that all named formulas are in fact array formulas.
Next we define the names, a and b, and link them to two worksheet cells so our users can enter values for a and b.
Next we define the named constant, δ, as π/2; and set _A and _B both equal to one.
The last thing is to create our named formulas for x and y:
x
=_A*SIN(a*t+δ)
and
y
=_B*SIN(b*t)
That's it. All we need to do now is create an XY (Scatter) chart with smooth lines and define a series:
Series name: ="Curve"
Series X values: =1!x
Series Y values: =1!y
Now we can plot an infinite number of Lissajous Curves using essentially no worksheet cells whatsoever. As part of the Excel Lissajous Curve Explorer I have included a gallery that you can scroll through to see a couple hundred of the best variations (in my opinion) that I've discovered thus far. You can edit the gallery by supplying values for a and b over in columns AB and AC on the worksheet.
I've provided a scroll control to allow for easy navigation through the gallery. You can also toggle to User Select for direct input of a and b values. There are scroll controls there as well.
If you find a Lissajous curve that you really like, tell me the values of a and b in the comments and I'll try to add a web gallery to this post!
Here's the workbook:
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=25c283b8-c88c-4ff7-933e-12f7a09b7902)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=12032934-c279-4f04-947e-fcf5d359df23)





![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=d85d1222-25de-4a91-917f-6d40f4e76e1c)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=f980730a-304a-4291-811e-a22b4c9db683)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=0fdabf22-3238-45c6-969d-772987756bc6)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=68c4a921-07f8-4a78-9bc4-04233a5351b4)

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=a66297c4-54d2-4fc5-b020-2db3cb155e77)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=7d01be28-90d1-46a4-aadf-09f7c0680044)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=32e93b7c-db39-4e12-aa3f-ad6df806df3e)


![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=04030d58-93a6-4609-8486-ceceab9e1c0f)



