javascriptjquerychartstooltipprotovis

Protovis Tooltip


I am trying to add a tool tip to my forecast as well as actuals indicator on a protovis chart by using the title attribute of my marker, but I don't know how to access it.

var vis = new pv.Panel()
.data(bullets)
.width(400)
.height(30)
.margin(20)
.left(100);

var bullet = vis.add(pv.Layout.Bullet)
.orient("left")
.ranges(function(d) d.ranges)
.measures(function(d) d.measures)
.markers(function(d) d.markers);

 bullet.range.add(pv.Bar)
  .event("mouseover", function() self.status ="orange");
 bullet.measure.add(pv.Bar).title(??????);

 bullet.marker.add(pv.Dot)
.shape("bar")
.lineWidth("4")
.height("1")
.title(???????);

What I want to be able to show are the actuals value and the forecast values as my tool tips


Solution

  • Gee, figured it out, you can do it by writing the following code

    bullet.marker.add(pv.Dot)
    .shape("bar")
    .lineWidth("4")
    .height("1")
    .title(function(d) {
    return d
     });