I believe I understand what you are asking for now.  What you should do is
merge your two arrays into one table, include all the x values in the first
column, in order, and for each x value, include the y value in one of your
two additional columns, and leave null values for the remainder.  So for
the data you gave, the table would look like this:

var data = google.visualization.arrayToDataTable([
  [1, 5, null],
  [3, null, 5],
  [4, null, 10],
  [5, 8, null],
  [9, 50, null]
]);

Then, in your options, you want to interpolate between the null values by
using the option interpolateNulls: true.   This option won't work for the
steppedAreaChart, but will for a LineChart.


On Wed, Nov 4, 2015 at 1:40 PM, <[email protected]> wrote:

> So I have 2 arrays, each contains the data for 1 line, but the 2 arrays
> have different number of elements, and each array might not contain all the
> x values of the other.
> I'm hoping for a easy way to render that.
>
> In the sample code it looked like all the arrays had to be the same size
> and all the x values must have a y value.  I was looking for a jagged
> array.  I guess for the missing x values I can just repeat the previous y
> value and make the array square.  Is there some other way besides doing
> that?
>
> On Wednesday, November 4, 2015 at 7:11:33 AM UTC-6, Daniel LaLiberte wrote:
>>
>> You can change the area of a stepped area chart to be transparent, using
>> the areaOpacity option set to 0, so only the line remains, if that is what
>> you want.  I don't understand your example data, however. Perhaps you
>> should sketch a chart that would show what you want.
>>
>> On Wed, Nov 4, 2015 at 2:19 AM, <[email protected]> wrote:
>>
>>> I am looking for a step line chart.  I found the step area chart but
>>> they aren't what I am looking for.  I am looking for a chart where not all
>>> x values are mapped to a y.  Like one set could be [1,5],[5,8],[9,50] and
>>> the other set could be [4,10][3,5].  Is there something that can do that?
>>> Can I use the api to draw it myself?  Sorry about asking such a noob
>>> question.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Visualization API" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at
>>> http://groups.google.com/group/google-visualization-api.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-visualization-api/c4d66f48-54b7-4a5c-8887-c8d0f07c960a%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-visualization-api/c4d66f48-54b7-4a5c-8887-c8d0f07c960a%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>>  - 978-394-1058
>> [email protected]   5CC, Cambridge MA
>> [email protected] 9 Juniper Ridge Road, Acton MA
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/645e5288-66c0-4578-8dce-0d002038fef9%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/645e5288-66c0-4578-8dce-0d002038fef9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJO%3DOJOE7WYmRuZ%2Bym%3DEFpwzasT%2B3L4HPvsP%3Dbm1TaTEig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to