+}
+
+/* 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;
+
+ if (!times)
+ times = g_hash_table_new_full(g_str_hash,
+ g_str_equal,
+ free,
+ free);
+
+ stimes = g_hash_table_lookup(times, s->id);
+
+ cairo_set_source_rgb(cr,
+ s->color->red,
+ s->color->green,
+ s->color->blue);
+
+ /* 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++;
+ }
+ }