+ Reply to Thread
Results 1 to 6 of 6

Get chart series from an array that has NOT been filled with a range

  1. #1
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    MS Office 365
    Posts
    25

    Get chart series from an array that has NOT been filled with a range

    This works:
    Please Login or Register  to view this content.
    How can I fill the array directly with values(read from file, NOT via cellvalues), and then use it in a chart?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,802

    Re: Get chart series from an array that has NOT been filled with a range

    If I understand what you are asking, the .values property of a series object can be an array constant instead of a range reference. See example here: https://msdn.microsoft.com/en-us/lib.../ff197014.aspx

    Can I assume you know how to load the values you have from whatever source you have identified into an array, or do you also need help with that step?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    MS Office 365
    Posts
    25

    Re: Get chart series from an array that has NOT been filled with a range

    Yes, I can fill the array with data from a file, like this
    Please Login or Register  to view this content.
    But 'With ActiveChart.FullSeriesCollection(1): .Values = vArrayFromFile(): End With' doesn't work. So the array must be filled differently?
    Last edited by Woulter; 10-25-2016 at 04:37 PM.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,802

    Re: Get chart series from an array that has NOT been filled with a range

    In what way does it not work? Is it giving a compiler error? runtime error? other error? running but doing the wrong thing?

    The only thing I can see about how you are loadiing the array is that the elements of strarrstring() will be text strings (numbers stored as text). Excel charts treat text strings (including numbers stored as text) as 0. You may need a val() function or similar in there to coerce the numbers as text into real numbers
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    MS Office 365
    Posts
    25

    Re: Get chart series from an array that has NOT been filled with a range

    It worked, but is there a limit to how many datapoints that can put in the array(32000)?

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,802

    Re: Get chart series from an array that has NOT been filled with a range

    I am not aware of any limits. The official published limits are that you are only limited by available memory. There might be an unpublished character limit to the =SERIES() "function" that defines a charts data series (which will need to include the entire array constant), you will probably have to give it a try and see if you bump up against such a limit. In that case, you can always write the values to a range in the sheet, or write them to a named array constant.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Populate multiple series within an xlLine chart from an array
    By DH123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2015, 12:03 PM
  2. Chart front-to-back series display if series are different chart types
    By Exconomist in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-06-2012, 06:49 AM
  3. 2D array as source data for new series in chart
    By goels in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-22-2012, 04:37 AM
  4. How to change the range in a 2-series chart
    By guarriman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2011, 06:02 AM
  5. Filled radar chart with multiple series
    By MSP77079 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-02-2007, 08:43 PM
  6. [SOLVED] How do I use a Defined Name range for a value series in a chart?
    By Don in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-17-2005, 07:05 PM
  7. [SOLVED] Array as chart series data source
    By Mitch in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2005, 06:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1