Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Charts - don't show points when value is zero

I'm using Google Charts to show some timeseries data like that shown below. Typically the data has a high proportion of zero values so you get lots of points sitting along the x-axis. I think this makes the chart look cluttered and I'd like to not show points where y=0.

Any ideas / pointers much appreciated.

Thanks,

ct

Busy chart with data points where y=0

like image 544
ct_ Avatar asked Nov 02 '12 09:11

ct_


People also ask

How do you make a chart start at 0 in Google Sheets?

Create or edit a bar, line, or mixed bar and line chart. If the metrics use the same unit of measurement, select the Display metrics on one axis check box. The range for the metrics are displayed on the left axis. Optionally, select the Start left axis at 0 checkbox to start the axis range at zero.

How do you show no data available on Google chart?

Use noData() method to enable "No data" label: chart. noData().


1 Answers

The best option is to use null instead of 0 (there will be missing points). And then you can use option interpolateNulls which will join the values.

like image 69
Ondrej Avatar answered Oct 05 '22 04:10

Ondrej