Your column 2 values are quoted. I wonder if that is related to the problem you are seeing.
After creating a view with only columns 0 and 2 in it, you will have a table with only 2 columns, indexed 0 and 1. The error message "Invalid column index 2. Should be an integer in the range [0-1]." means you are referencing column index 2 somewhere. On Tue, Apr 18, 2017 at 2:08 PM, John Held <[email protected]> wrote: > I like Google Charts a lot, but have run into something I haven't seen > posted anywhere. > > In short, I am using different controls to select which row of a 36 row > json file to display based on a column labeled "Index". > > If I set the columns as below, I can exclude the Index column with a > ProgrammaticSlider set as a NumberRangeFilter. The problem is that it > seems impossible to set the Slider above 9 using a control. The chart > becomes unresponsive after selecting any double-digit row. > > This is what I have when attempting this : > > programmaticChart.setView({'columns': [0, 1]}); //this works, but only > for 9 rows! > > cols": [ > {"id":"","label":"Year","pattern":"","type":"string"}, > {"id":"","label":"Cases","pattern":"","type":"number"}, > {"id":"","label":"Index","pattern":"","type":"number"} > ], > > On the other hand, I can set the Slider to an Index up to 36 using > programmaticChart.setView({'columns': [0, 1, 2]}) and select the row I > want - which of course doesn't help because there's no need to see columns > with the index. > > However setting the columns to skip column 1 creates the following error > (and the code and json columns are below): > "Invalid column index 2. Should be an integer in the range [0-1]." > . > programmaticChart.setView({'columns': [0, 2]}); //this now blows up > with the following column definitions > > "cols": [ > {"id":"","label":"Year","pattern":"","type":"string"}, > {"id":"","label":"Index","pattern":"","type":"number"}, > {"id":"","label":"Cases","pattern":"","type":"number"} > ], > > Here's three rows of the json file I want to use displaying column 2 as an > example: > > {"c":[{"v":"2013","f":null},{"v":1,"f":null},{"v":"10","f":null}]}, > {"c":[{"v":"2013","f":null},{"v":2,"f":null},{"v":"20","f":null}]}, > {"c":[{"v":"2013","f":null},{"v":3,"f":null},{"v":"30","f":null}]}, > > > Any help would be greatly appreciated! > > -- > 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 google-visualization-api@ > 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/95b06fa1-e2f1-4f1e-9a77- > 9c3a6c139841%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/95b06fa1-e2f1-4f1e-9a77-9c3a6c139841%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> [email protected] <[email protected]> 5CC, Cambridge 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 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/CAOtcSJNFYLRGFC%2BQWyBH9qCDf%2B2R-0vc%2BoOi-OQtTcDXuhpeYg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
