Many XY curves with one SeriesCollection

  • Good morning,
    I’m working with Excel 2010 to plot, on an existing chart, n distinct XY curves , in one shot (1=<n<=100,each curve about 10-100 points) .
    To do this, I’m using a single SeriesCollection (because easy to manage,with a unique format for all the n curves, and above all, erasable all at once when no longer needed),whose source is a vertical range on two columns, as the red lines in the attached spreadsheet.
    My question is: it is possible to feed the same SeriesCollection via software, without dumping the data on a range?


    I have tried various kind of arrays, and/or recursive calls of subroutines, but without success.
    I obtain even a SeriesCollection that gives a single curve instead of a set of distinct curves(see VBA macro in the spreadsheet).
    Thanks for any help.forum.ozgrid.com/index.php?attachment/51215/

  • Re: Many XY curves with one SeriesCollection



    Hi Herbds7,thank you for your answer
    You did a nice job with a classic solution, o
    ne SeriesCollection for each curve, in our example:


    Three curves XY = three arrays assigned to three different SeriesCollection()


    My goal is instead rather different: One SeriesCollection for three curves.
    With reference to my previous worksheet, this can be accomplished by assigning a range and
    writing something like this:
    ch.SeriesCollection (SC $). XValues=. Range (.Cells (5, 2),.Cells (42, 2))
    ch.SeriesCollection (SC $). Values =. Range (. Cells (5, 3),. Cells (42, 3))


    Unfortunately, in my applications I can not work with ranges, because I have to draw hundreds of curves and I do not want to fill the worksheet with numbers that serve only to graphic outputs.
    For this reason I would like to know if exists a VBA syntax, which enable the assigning of the XYcoordinates for all the curves, grouped into a single data file. Somethinglike this:


    ch.SeriesCollection (SC $). XValues = [.. Particular sequence of X coordinates of all the curves ..]
    ch.SeriesCollection (SC $). Values = [.. Particular sequence of Y coordinates ofall the curves..]


    Cheers



  • Re: Many XY curves with one SeriesCollection


    If you don't want the numbers for the charts to fill the worksheet, where do they come from?
    Are they generated by formulas that are based on data within the worksheet?
    Your file does list the chart numbers on the worksheet.
    Do you want to just merge multiple lists into another workbook list?
    How do you define "...Particular sequence.." ?
    Please attach a file that addresses these issues.
    Here is an example of a step chart whose macro generated numbers do not appear on the worksheet.
    http://8936e6d9f85be098ae08-f2…rackcdn.com/11_26_12.xlsm

  • Re: Many XY curves with one SeriesCollection


    Hi Herbds7,
    So many questions and doubts, I will try to answer in order.

    I'm not using Excel as a spreadsheet to make tables and calculations, but only as a userinterface for input / output data. Due to his complexity, the processing is outside.


    - The data input is processed by an underlying VBA program, that transmits to the worksheet only the outputs to display in tables and charts.
    - This program has also a graphic module, a wireframe modeller for surfaces.
    - This modeller generates sequences of points (XY coordinates) to draw 2D curves.
    - These curves are grouped into "families" or homogeneous groups of curves.
    - Each family includes 10-100 curves and goes on the chart with his own format (line color,thickness..etc) to distinguish it from the others.


    My worksheet is just one example to explain a simple way, what I'm trying to do.

    Those numbers you see in the Range (. Cells (5,2). Cells (42,3)) come from three two-dimensional arrays stored in the memory of the PC.

    They represent the grid of three B-splines, but you can considerer them as one of the many families of curves generated by the system.
    As regards Excel they are only three curves XY, to draw with the same format.


    As I mentioned earlier, I want to feed these data to a uniqueSeriesCollection (not three) via software, without damping data in a range on the worksheet.

    The result I want to achieve are three distinct 2D curves.

    We have seen how this task can be accomplished by placing these data in a vertical range with empty cells between a set of data and the other.
    I am convinced that there must be also a way to realize the same thing via software, giving to the SeriesCollection these arrays, or something else that emulates that range.
    The part [.. Particular sequence...] is the one that I don’t know how to write, for this target.


    ch.SeriesCollection (SC $). XValues = [.. Particular sequenceof X coordinates of all the curves ..]
    ch.SeriesCollection (SC $). = Values [.. Particular sequenceof Y coordinates of all the curves ..]


    I hope it's clearer now.



    I looked at what you sent me, but it is really another thing. I do not believe may serve me.
    However, thanks anyway.

    Cheers

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!