return 10 + _this.index() * 60; // translate(x,_)
}
}
);
PVBulletLayout bullet = vis.add(PV.Layout.Bullet()).orient(LEFT)
.ranges(new JsFunction<JsArrayNumber>() {
public JsArrayNumber f(JsArgs args) {
Bullet d = args.getObject();
return JsUtils.toJsArrayNumber(d.ranges);
}
}).measures(new JsFunction<JsArrayNumber>() {
public JsArrayNumber f(JsArgs args) {
Bullet d = args.getObject();
return JsUtils.toJsArrayNumber(d.measures);
}
}).markers(new JsFunction<JsArrayNumber>() {
public JsArrayNumber f(JsArgs args) {
Bullet d = args.getObject();
return JsUtils.toJsArrayNumber(d.markers);
}
});
// workaround for right hand side labels
graphWidget.addAttachHandler(new AttachEvent.Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
Element svg = graphWidget.getElement().getFirstChildElement();
if(svg!=null)
{
svg.setAttribute("overflow", "visible");
}
}
});
bullet.strokeStyle("#CFCFCF");
bullet.lineWidth(0.9);
bullet.range().add(PV.Bar).fillStyle("#ffffff");
bullet.measure().add(PV.Bar).fillStyle("#666666");
bullet.marker().add(PV.Dot).shape(PVShape.TRIANGLE).fillStyle("white");
bullet.tick().add(PV.Rule)
.strokeStyle("#CFCFCF")
.anchor(BOTTOM)
.add(PV.Label)
.text(bullet.x().tickFormat());
// title
bullet.anchor(LEFT).add(PV.Label).font("12px sans-serif")
.textAlign(RIGHT).textBaseline(BOTTOM)
.text(new JsStringFunction() {
public String f(JsArgs args) {
Bullet d = args.getObject(0);
return d.title;
}
});
// subtitle
bullet.anchor(LEFT).add(PV.Label).textStyle("#616161").textAlign(RIGHT)
.textBaseline(TOP).text(new JsStringFunction() {
public String f(JsArgs args) {
Bullet d = args.getObject(0);
return d.subtitle;
}
});
// scale
bullet.anchor(RIGHT)
.add(PV.Label)
.textStyle("#616161")
.textAlign(LEFT)
.textBaseline(MIDDLE)
.text(new JsStringFunction() {