I am trying to use d3js code to fetch the birt daset and disply a barchart using d3js code as below
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js">
<script type="text/javascript">
var w = 500;
var h = 100;
var barPadding = 1;
var dataset=[<value-of>row["CUSTOMERNUMBER"]</value-of>];
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);
svg.selectAll("rect")
.data(dataset)
.enter()
.append("rect")
.attr("x", function(d, i) {
return i * (w / dataset.length);
})
.attr("y", function(d) {
return h - (d * 4);
})
.attr("width", w / dataset.length - barPadding)
.attr("height", function(d) {
return d * 4;
})
.attr("fill", function(d) {
return "rgb(0, 0, " + (d * 10) + ")";
});
svg.selectAll("text")
.data(dataset)
.enter()
.append("text")
.text(function(d) {
return d;
})
.attr("text-anchor", "middle")
.attr("x", function(d, i) {
return i * (w /dataset.length) + (w /dataset.length - barPadding) / 2;
})
.attr("y", function(d) {
return h - (d * 4) + 14;
})
.attr("font-family", "sans-serif")
.attr("font-size", "11px")
.attr("fill", "white");
</script>
But m not geting the complete dataset values,the code var dataset=[<value-of>row["CUSTOMERNUMBER"] giving only the last value in the column and not the complete column values