var scaleX = d3.time.scale().rangeRound([0, width]);
scaleX.domain(d3.extent(data, function(d){ return d.date; }));
var label = layer.selectAll(".label").data(data);
label.exit().remove();
label.enter()
.append("text")
.attr("class", "label noselect")
.text(function(d) { return moment(d.date).format("DD MMMM YYYY") })
.attr("x", function(d){return scaleX(d.date) })
.attr("y", 40);
price.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
}
@Override
public void keyReleased(KeyEvent e) {
System.out.println("Price text: " + price.getText());
}
@Override
public void keyPressed(KeyEvent e) {
}
});