1 dashboard 1 controller and 2+ line charts - hiding lines

51 views
Skip to first unread message

nadavs

unread,
Jun 3, 2018, 10:20:05 AM6/3/18
to Google Visualization API


hi,
I'm building a statistics system for school and I'm using google charts.
I'm sorry but i cant post the whole code because I am not allowed. 

anyways I have a panel that shows data and it looks like this:

so i have 1 dashboard that binds a changeratefilter with 2+ linecharts.

my data table looks like this:
timestap | line1  | line2  | line3  | ...
date0      | 1val0 | 2val0 | 3val0 | ...
date1      | 1val1 | 2val1 | 3val1 | ...
... 
where date0 is of type Date and xvaly is type number.

I'm trying to make the charts show different lines for each charts but still wants one controller to rule them all (One controller to find them, One controller to bring them all and in the darkness bind them)

but i get an error every time when i try to use view: {columns:[0,2]} in my chartwrappers:
Invalid column index 2. Should be an integer in the range [0-1].
getNumberOfColumns does return the correct value of 4.

so i dont know what im doing wrong.
how can i hide the lines but still make the controller to show all of them and control all of them?

Thank you!

nadavs

unread,
Jun 3, 2018, 10:23:09 AM6/3/18
to Google Visualization API
 Invalid column index 2. Should be an integer in the range [0-1].
this ^^^^^^^^^ applies to any column index greater than 1 by the way.

Daniel LaLiberte

unread,
Jun 3, 2018, 8:45:43 PM6/3/18
to Google Visualization API
At the point where it complains about the column index 2, the data table given to that part of your dashboard only has 2 columns, with indices 0 and 1.  

So I would recommend simplifying your dashboard as much as possible to figure out what is going wrong.  Does it work with only one chart?

On Sun, Jun 3, 2018 at 10:23 AM nadavs <nsi...@gmail.com> wrote:
 Invalid column index 2. Should be an integer in the range [0-1].
this ^^^^^^^^^ applies to any column index greater than 1 by the way.

--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/6d00f3c5-3c33-4053-a916-73d839383ff1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

nadavs

unread,
Jun 5, 2018, 4:08:17 AM6/5/18
to Google Visualization API
ok so i have built an example for this subject:

here: http://jsfiddle.net/hzdyojca/

data table is hard coded an all columns exist when initialized:
['Date', 'A2', 'A3', 'A4'],
[2004  , 3.5 , 5   , 4.4 ],
[2005  , 3.7 , 5   , 4.5 ],
[2006  , 3.7 , 5   , 4.6 ],
[2007  , 3.8 , 5   , 4.7 ]

As you can see chart A presents column 0 and 1 perfectly.
chart B is supposed to preset column 0 and 2 (date and A3)
and chart C is supposed to present some of them together.

I don't understand how to make chart B show only the red line.

would appreciate more help.
thanks.


On Monday, June 4, 2018 at 3:45:43 AM UTC+3, Daniel LaLiberte wrote:
At the point where it complains about the column index 2, the data table given to that part of your dashboard only has 2 columns, with indices 0 and 1.  

So I would recommend simplifying your dashboard as much as possible to figure out what is going wrong.  Does it work with only one chart?

On Sun, Jun 3, 2018 at 10:23 AM nadavs <nsi...@gmail.com> wrote:
 Invalid column index 2. Should be an integer in the range [0-1].
this ^^^^^^^^^ applies to any column index greater than 1 by the way.

--
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 google-visualization-api+unsub...@googlegroups.com.


--

Daniel LaLiberte

unread,
Jun 5, 2018, 9:56:34 AM6/5/18
to Google Visualization API
This appears to be triggering yet another bug in the startup animation.  If you remove the startup animation option, it all works. See http://jsfiddle.net/hzdyojca/31/  

I have no idea why startup animation has a problem with such a view, but if you need it, it might be best to create a separate datatable with the columns you need using the toDataTable() method.

On Tue, Jun 5, 2018 at 4:08 AM nadavs <nsi...@gmail.com> wrote:
ok so i have built an example for this subject:

here: http://jsfiddle.net/hzdyojca/

data table is hard coded an all columns exist when initialized:
['Date', 'A2', 'A3', 'A4'],
[2004  , 3.5 , 5   , 4.4 ],
[2005  , 3.7 , 5   , 4.5 ],
[2006  , 3.7 , 5   , 4.6 ],
[2007  , 3.8 , 5   , 4.7 ]

As you can see chart A presents column 0 and 1 perfectly.
chart B is supposed to preset column 0 and 2 (date and A3)
and chart C is supposed to present some of them together.

I don't understand how to make chart B show only the red line.

would appreciate more help.
thanks.

On Monday, June 4, 2018 at 3:45:43 AM UTC+3, Daniel LaLiberte wrote:
At the point where it complains about the column index 2, the data table given to that part of your dashboard only has 2 columns, with indices 0 and 1.  

So I would recommend simplifying your dashboard as much as possible to figure out what is going wrong.  Does it work with only one chart?

On Sun, Jun 3, 2018 at 10:23 AM nadavs <nsi...@gmail.com> wrote:
 Invalid column index 2. Should be an integer in the range [0-1].
this ^^^^^^^^^ applies to any column index greater than 1 by the way.

--
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 google-visualizati...@googlegroups.com.


--

--
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 google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.


--

Daniel LaLiberte

unread,
Jun 5, 2018, 9:58:42 AM6/5/18
to Google Visualization API
Sorry, try this instead:  http://jsfiddle.net/hzdyojca/34/
Reply all
Reply to author
Forward
0 new messages