diff --git a/goffice/data/go-data-impl.h b/goffice/data/go-data-impl.h
index b8c0e09..0906555 100644
--- a/goffice/data/go-data-impl.h
+++ b/goffice/data/go-data-impl.h
@@ -31,7 +31,8 @@ G_BEGIN_DECLS
 typedef enum {
 	GO_DATA_CACHE_IS_VALID =	1 << 0,
 	GO_DATA_IS_EDITABLE =		1 << 1,
-	GO_DATA_SIZE_CACHED =		1 << 2
+	GO_DATA_SIZE_CACHED =		1 << 2,
+	GO_DATA_HAS_VALUE = 1 << 3
 } GODataFlags;
 
 struct _GOData {
diff --git a/goffice/data/go-data.c b/goffice/data/go-data.c
index 2d46135..a960907 100644
--- a/goffice/data/go-data.c
+++ b/goffice/data/go-data.c
@@ -347,6 +347,15 @@ go_data_is_varying_uniformly (GOData *data)
 	return go_data_check_variation (data, GO_DATA_VARIATION_CHECK_UNIFORMLY);
 }
 
+gboolean
+go_data_has_value (GOData const *data)
+{
+	g_return_val_if_fail (GO_IS_DATA (data), FALSE);
+	if (!(data->flags & GO_DATA_CACHE_IS_VALID))
+		go_data_get_values (GO_DATA (data));
+	return data->flags & GO_DATA_HAS_VALUE;
+}
+
 unsigned int
 go_data_get_n_dimensions (GOData *data)
 {
@@ -724,7 +733,7 @@ go_data_scalar_get_markup (GODataScalar *scalar)
 static void
 _data_vector_emit_changed (GOData *data)
 {
-	data->flags &= ~(GO_DATA_CACHE_IS_VALID | GO_DATA_VECTOR_LEN_CACHED);
+	data->flags &= ~(GO_DATA_CACHE_IS_VALID | GO_DATA_VECTOR_LEN_CACHED | GO_DATA_HAS_VALUE);
 }
 
 static unsigned int
@@ -816,6 +825,14 @@ go_data_vector_get_values (GODataVector *vec)
 
 		(*klass->load_values) (vec);
 
+		{
+			double min, max;
+			go_data_get_bounds (&vec->base, &min, &max);
+			if (go_finite (min) && go_finite (max) && min <= max)
+				vec->base.flags |= GO_DATA_HAS_VALUE;
+			
+		}
+
 		g_return_val_if_fail (vec->base.flags & GO_DATA_CACHE_IS_VALID, NULL);
 	}
 
@@ -921,7 +938,7 @@ go_data_vector_vary_uniformly (GODataVector *vec)
 static void
 _data_matrix_emit_changed (GOData *data)
 {
-	data->flags &= ~(GO_DATA_CACHE_IS_VALID | GO_DATA_MATRIX_SIZE_CACHED);
+	data->flags &= ~(GO_DATA_CACHE_IS_VALID | GO_DATA_MATRIX_SIZE_CACHED | GO_DATA_HAS_VALUE);
 }
 
 static unsigned int
@@ -1060,6 +1077,13 @@ go_data_matrix_get_values (GODataMatrix *mat)
 
 		(*klass->load_values) (mat);
 
+		{
+			double min, max;
+			go_data_get_bounds (&mat->base, &min, &max);
+			if (go_finite (min) && go_finite (max) && min <= max)
+				mat->base.flags |= GO_DATA_HAS_VALUE;
+		}
+
 		g_return_val_if_fail (mat->base.flags & GO_DATA_CACHE_IS_VALID, NULL);
 	}
 
diff --git a/goffice/data/go-data.h b/goffice/data/go-data.h
index f163527..161c890 100644
--- a/goffice/data/go-data.h
+++ b/goffice/data/go-data.h
@@ -48,6 +48,7 @@ void		go_data_get_bounds		(GOData *data, double *minimum, double *maximum);
 gboolean	go_data_is_increasing		(GOData *data);
 gboolean	go_data_is_decreasing		(GOData *data);
 gboolean	go_data_is_varying_uniformly	(GOData *data);
+gboolean	go_data_has_value	    (GOData const *data);
 
 unsigned int 	go_data_get_n_dimensions 	(GOData *data);
 unsigned int	go_data_get_n_values		(GOData *data);
diff --git a/goffice/graph/gog-series.c b/goffice/graph/gog-series.c
index 7569d2f..4ba0f8e 100644
--- a/goffice/graph/gog-series.c
+++ b/goffice/graph/gog-series.c
@@ -1256,7 +1256,7 @@ gog_series_get_data (GogSeries const *series, int *indices, double **data, int n
 		index = indices != NULL ? indices[i] : i;
 		if (index >= first && index <= last &&
 		    (vector = series->values[index].data) != NULL) {
-			data[i] = go_data_get_values (vector);
+			data[i] = (go_data_has_value (vector))? go_data_get_values (vector): NULL;
 			vector_n_points = go_data_get_vector_size (vector);
 			if (!is_set) {
 				is_set = TRUE;
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index f72acdb..cf214b8 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -1118,7 +1118,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
 			n = gog_series_get_xyz_data (GOG_SERIES (series), &x_vals, &y_vals, &z_vals);
 		else
 			n = gog_series_get_xy_data (GOG_SERIES (series), &x_vals, &y_vals);
-		if (n < 1)
+		if (n < 1 || y_vals == NULL)
 			continue;
 
 		style = go_styled_object_get_style (GO_STYLED_OBJECT (series));
