Scene
1. Draw grid lines
How to use. Innerticksize (): Specify the inner scale size
Or
. ticksize (inner, outer):
2, inside and outside the tick line
Innerticksize
Outerticksize
Ticksize
Let's see the demand adjustment.
3.
Tickformat formatting
Tickpadding the spacing between ticks and tick marks
Tickvalues the specified scale value, according to the XScale
Test.prototype.xScale = function (length) {return d3.scale.linear (). Domain ([0, Length-1]) . Range ([This.padding, this.width-this.padding]); } Test.prototype.xAxis = function (XScale) {return D3.svg.axis (). Scale (XScale) . Orient ("Bottom"). Ticks (5)//. Tickformat (D3.format ("%Y"))//. ti Ckvalues ([1, 2, 3, 5, 8,])//. Ticksize (-(this.width-this.padding * 2))//. Inner Ticksize (-(this.width-this.padding * 2)). Outerticksize (-(this.width-this.padding * 2)) . Ticksize (-(10)); } Test.prototype.xBars = function (SVG, Xaxis) {return svg.append (' G '). attr (' class ', ' X Axis '). attr (' transform ', ' translate (0, ' + (this.height-this.padding) + ') '). Call (Xaxis) ; }
D3 API Axis