wefra-odoo11/custom/scripts/d3js/chart/axis.js
2019-10-02 23:28:58 +02:00

28 lines
832 B
JavaScript

Axis = {
addAxis: function(svg, axis, xTranslate, yTranslate){
return svg.append("g")
.attr("transform", "translate("+xTranslate+", "+yTranslate+")")
.call(axis);
},
addTop: function(svg, scale, xTranslate, yTranslate){
var axis = d3.axisTop(scale);
return this.addAxis(svg, axis, xTranslate, yTranslate);
},
addRight: function(svg, scale, xTranslate, yTranslate){
var axis = d3.axisRight(scale);
return this.addAxis(svg, axis, xTranslate, yTranslate);
},
addBottom: function(svg, scale, xTranslate, yTranslate){
var axis = d3.axisBottom(scale);
return this.addAxis(svg, axis, xTranslate, yTranslate);
},
addLeft: function(svg, scale, xTranslate, yTranslate){
var axis = d3.axisLeft(scale);
return this.addAxis(svg, axis, xTranslate, yTranslate);
}
};