[5.1] d3.js Integrated axes-charts-text labels

Source: Internet
Author: User

My personal blog is: www.ourd3js.com

CSDN Blog for: blog.csdn.net/lzhlzz

Reprint please indicate the source, thank you.

The previous sections explain icons, axes, scales, and so on, and this section integrates these into a practical chart. The result diagram is as follows:

The code looks like this:


The following sections explain the above code separately:

    • 31-34 rows: Randomly generated data, assigned to array
    • 36-38 rows: Defining SVG
    • 40-54 rows: Define scale (proportions) and axes of the axis, 48 behavior X-axis, 52 behavior Y-axis
    • 56-62 rows: Define the scale of the column chart
    • 64-78 line: Draw a column chart, pay attention to the use of scale
    • 80-98 lines: Draw text labels, same note scale
    • 100-108 rows: Drawing axes
Note: When drawing, pay attention to the order of the drawing, otherwise you may be able to overwrite some of the necessary things. Especially the axis, preferably put to the last draw.

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.