+ if (tooltip) {
+ /*
+ * use msec to avoid dropping too much precision when
+ * storing as an integer.
+ */
+ double xval = getx(x);
+ double minx = xval - (g->xtick_one_val * TOOLTIP_DELTA);
+ double maxx = xval + (g->xtick_one_val * TOOLTIP_DELTA);
+ struct prio_tree_node *ret;
+
+ xval = xval * 1000.0;
+ minx = minx * 1000.0;
+ maxx = maxx * 1000.0;
+
+ INIT_PRIO_TREE_NODE(&x->node);
+ x->node.start = minx;
+ x->node.last = maxx;
+ if (x->node.last == x->node.start) {
+ x->node.last += fabs(g->xtick_delta);
+ if (x->node.last == x->node.start)
+ x->node.last++;
+ }
+
+ /*
+ * If ret != &x->node, we have an alias. Since the values
+ * should be identical, we can drop it
+ */
+ ret = prio_tree_insert(&i->prio_tree, &x->node);
+ if (ret == &x->node) {
+ x->tooltip = strdup(tooltip);
+ i->tooltip_count++;
+ }
+ }
+
+ if (g->per_label_limit != -1 &&
+ i->value_count > g->per_label_limit) {