I'd like give the user the ability to hide and show lines on a line chart.
But eventually a user will 'turn off' all the columns of a chart so I'm
looking for a way to hide ALL the columns of a chart.
Given this partial pseudo code:
myDataTable.addColumn('date', 'Month');
myDataTable.addColumn('number', 'Line 1');
myDataTable.addColumn('number', 'Line 2');
myDataTable.addColumn('number', 'Line 3');
... then add appropriate data to myDataTable...
myDataView = new google.visualization.DataView(myDataTable);
myDataView .setColumns([0, 1, 2, 3]);
myLineChart .draw(myDataView, myOptions);
(Shows all the columns of the chart)
But when I call this:
myDataView .setColumns([0]);
myLineChart .draw(myDataView, myOptions);
I get this error:
Not enough columns given to draw the requested chart.
I've also tried
myDataView .hideColumns([1,2,3])
draw...
and get the same error message.
Is there anyway to draw a chart when all the columns need to be hidden?
--
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/16af04f2-8015-45ce-b24c-aeba4dc0e60b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.