The controls can filter your data to limit the quantity displayed.

You can build a custom paging system if you want to.  Here's a basic 
framework you can use to do it:

var total = data.getNumberOfRows();
var pageSize = 500;
var pageCount = Math.ceil(total / pageSize);
var pageContainer = document.querySelector('#pageContainer');
for (var i = 0; i < pageCount; i++) {
    var a = document.createElement('a');
    a.class = 'pageButton';
    a.dataset.page = i;
    a.innerHTML = i + 1;
    pageContainer.appendChild(a);
}
function page (e) {
    if ((' ' + e.target.className + ' ').indexOf(' pageButton ') > -1) {
        // user clicked a page button
        var page = e.target.dataset.page;
        var startRow = page * pageSize;
        var endRow = Math.min((page + 1) * pageSize, total) - 1;
        var view = new google.visualization.DataView(data);
        view.setRows(startRow, endRow);
        chart.draw(view, options);
    }
}
if (document.addEventListener) {
    pageContainer.addEventListener('click', page);
}
else {
    pageContainer.attachEvent('onclick', page);
}

It likely needs a lot of work and customization to your particular needs, 
as I just wrote this up quick without testing it, but it should provide a 
basic starting point to work from.

On Friday, August 15, 2014 12:29:05 PM UTC-4, cyb wrote:
>
> Hi,
>
> why should i look at the Controls ? The problem is, if i use big 
> DataTables with thousends of data points it slows down my web-application. 
> For Example, if i show 10000 DataPoints at the same time it is very slow.. 
> I want that i can show only 500-1000 DataPoints at the same time. and the 
> next 500-1000 points are on page 2 and so on...
> Have you an idea, how i can imlement such a paging function ?
>
> Best regards
> cyb
>
> Am Donnerstag, 14. August 2014 01:50:36 UTC+2 schrieb Andrew Gallant:
>>
>> There are no paging controls for charts.  You *could* implement paging 
>> for a chart, but paging isn't very user-friendly.  Have you looked at the 
>> Controls 
>> <https://google-developers.appspot.com/chart/interactive/docs/gallery/controls#gallery>
>>  
>> to see if any of those will work for you?
>>
>> On Wednesday, August 13, 2014 4:34:44 PM UTC-4, cyb wrote:
>>>
>>> Hi,
>>>
>>> im using a ChartWrapper with a DataTable and a View to show only 
>>> specific values in my chart.
>>>
>>> If i use the normal TableChart i can activate a paging with the options 
>>> page 
>>> and pageSize. Can i do the same with normal Charts like Line or Area Charts 
>>> !?
>>> And if not.. are there any plans to implement such a feature in the near 
>>> future? or can someone help me to implement such a feature?
>>> I need this, because i have performence problems if i  use big 
>>> DataTables with many thousand values.
>>>
>>> Best regards
>>> cyb
>>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to