+ cairo_set_dash(cr, NULL, 0, 0);
+}
+
+/* Keys: sensor identifier.
+ *
+ * Values: array of time_t. Each time_t is corresponding to a sensor
+ * measure which has been used as the start point of a Bezier curve.
+ */
+static GHashTable *times;
+
+static void draw_sensor_smooth_curve(struct psensor *s,
+ cairo_t *cr,
+ double min,
+ double max,
+ int bt,
+ int et,
+ struct graph_info *info)
+{
+ int i, dt, vdt, j, k, found;
+ double x[4], y[4], v;
+ time_t t, t0, *stimes;
+ GdkRGBA *color;
+
+ if (!times)
+ times = g_hash_table_new_full(g_str_hash,
+ g_str_equal,
+ free,
+ free);
+
+ stimes = g_hash_table_lookup(times, s->id);
+
+ color = config_get_sensor_color(s->id);
+
+ cairo_set_source_rgb(cr,
+ color->red,
+ color->green,
+ color->blue);
+ gdk_rgba_free(color);
+
+ /* search the index of the first measure used as a start point
+ * of a Bezier curve. The start and end points of the Bezier
+ * curves must be preserved to ensure the same overall shape
+ * of the graph. */
+ i = 0;
+ if (stimes) {
+ while (i < s->values_max_length) {
+ t = s->measures[i].time.tv_sec;
+ v = s->measures[i].value;
+
+ found = 0;
+ if (v != UNKNOWN_DBL_VALUE && t) {
+ k = 0;
+ while (stimes[k]) {
+ if (t == stimes[k]) {
+ found = 1;
+ break;
+ }
+ k++;
+ }
+ }
+
+ if (found)
+ break;
+
+ i++;
+ }
+ }
+
+ stimes = malloc((s->values_max_length + 1) * sizeof(time_t));
+ memset(stimes, 0, (s->values_max_length + 1) * sizeof(time_t));
+ g_hash_table_insert(times, strdup(s->id), stimes);
+
+ if (i == s->values_max_length)
+ i = 0;
+
+ k = 0;
+ dt = et - bt;
+ while (i < s->values_max_length) {
+ j = 0;
+ t = 0;
+ while (i < s->values_max_length && j < 4) {
+ t = s->measures[i].time.tv_sec;
+ v = s->measures[i].value;
+
+ if (v == UNKNOWN_DBL_VALUE || !t) {
+ i++;
+ continue;
+ }