This seems like a constraint that the user should enforce, not Google Charts. I'm not aware of any charting libraries that support what you want. After all, the user is providing the data to Google; the notion of having the user say "here's my data, but make sure that I've only given you ten rows" is like going out for ice cream and telling them not to sell you too much.
The code I provided will get you the same effect. Hope it helps! - Sergey On Mon, Dec 17, 2012 at 4:58 PM, diferdin <[email protected]> wrote: > I kind of suspected so, and I had looked at the API reference before > asking this group. I was just hoping I had overlooked something, but > unfortunately it does not look like the case. > It seems as a normal feature to have in a charting library, why is it not > there? Would it not be good to have it? > > Cheers. > > > On Monday, December 17, 2012 9:40:14 PM UTC, Sergey wrote: >> >> There's no built in way to do this, but you can accomplish the same >> thing using the following bit of code: >> function dataReceived(data) { >> datatable.addRows(data); >> var sizediff = datatable.get**NumberOfRows() - MAX_NUMBER_**OF_ROWS; >> if (sizediff > 0) { >> datatable.removeRows(0, size**diff); >> } >> } >> You can find more information about which methods DataTables have on its >> reference >> page<https://developers.google.com/chart/interactive/docs/reference#DataTable> >> . >> >> - Sergey >> > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-visualization-api/-/F1r9kNLzM6oJ. > > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
