From 5384a9f745d7aa31edc1b028a8ec0119dabdd1f5 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Mon, 12 Dec 2011 00:20:51 +0100 Subject: klickbare plots --- ebus/webapp/static/src/d3.plot.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ebus/webapp/static/src/d3.plot.js') diff --git a/ebus/webapp/static/src/d3.plot.js b/ebus/webapp/static/src/d3.plot.js index e50cb5e..d9a7d04 100644 --- a/ebus/webapp/static/src/d3.plot.js +++ b/ebus/webapp/static/src/d3.plot.js @@ -4,16 +4,21 @@ function d3_plot(container) { this.opt = { w:550, h:200, margin:30 }; - this.element = container.append("svg:svg") + this.element = container.append("svg:g") .classed("d3.plot_plot",true) .attr("width", this.opt.w) .attr("height", this.opt.h); - + + this.element.append("svg:rect") + .attr("width", this.opt.w) + .attr("height", this.opt.h) + .style("fill", "white"); + this.element.append("svg:text") .classed("d3-plot_wait", true) .attr("x", this.opt.w/2) .attr("y", this.opt.h/2) - .attr("text-anchor", "middle") + .attr("text-anchor", "center") .text("Bitte warten"); }; @@ -59,7 +64,7 @@ d3_plot.prototype = { .text(function(d){return tick_format(d);}) .attr("x", function(d) {return x(d);}) .attr("y", -5) - .attr("text-anchor", "middle"); + .attr("text-anchor", "center"); g.selectAll(".ylabel") .data(y.ticks(5)).enter() -- cgit v1.2.1