D3 API Axis

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.