Let me see if I have this correct: you want to get the number of non-null,
non-zero points currently in view in the chart, right?
Try this:
google.visualization.events.addListener(rangeFilter, 'statechange',
function (e) {
// check e.inProgress to see if the rangeFilter is currently being
changed, in case you only want to fire this once it's done
var dt = chart.getDataTable();
var rows = dt.getFilteredRows([{column: <the column you want to check>,
minValue: 0}]);
var zeroRows = dt.getFilteredRows([{column: <the column you want to
check>, value: 0}]);
// remove 0's from the rows
for (var i = 0; i < zeroRows.length; i++) {
var index = rows.indexOf(zeroRows[i]);
if (index > -1) {
// should always be true, but check just in case
rows.splice(index, 1);
}
}
// rows.length is the count of rows with non-zero, non-null values in
the current view
});
On Saturday, September 7, 2013 10:49:18 AM UTC-4, dilishali wrote:
>
> I am showing at every point a percent of the first visible value for a
> column in my chart. However if the first value is null or 0 everything else
> will be 0.
> To overcome this, if the first value is 0 or null I move forward 1 point
> until I find a point with a good value.
> But sometimes there are more values of 0 or null than visible points, so
> an error indicator appears.
>
> How can I get the number of visible points for a column, or how can I
> disable the errors?
>
--
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/groups/opt_out.