D3.js area function

Source: Internet
Author: User

Var area = d3.svg.area (). Interpolate ("monotone"). x (function (d)  { return x (d.date ),  }). y0 (260). Y1 (function (d)  { return y (d.price);  });     //.x () The coordinates of the data point at the X-axis d.date    //.y1 The data point in the y-axis coordinate d.price, which determines the coordinate (value)     //of a data point. Y0 equivalent to the converter [0,260], the value of the Y1 map to [0-260] (pixels) to show that the function of     //area function is to draw these isolated points into a closed area, creating a path     //interpolate ("monotone") here uses the Bezier curve to draw the area so that the interpolation method data: Date,pricejan 2000,300apr 2000,400jul  2000,500 generates path (the data corresponds to the second path, the decimal point is deleted): m 0,260 moves to the lower left corner (0,260), 260 is the total height c 70,239,314,170,455,130 from the starting point (2, 260) Draw curve to 455,130s 839,20,910,0 from above (455,130) draw curve to 910,0l 910,260 draw straight line to 910,260c  834,260,606,260,455,260 Draw curve from top (910,260) to 455,260s 75,260,0,260z from above (455,260) curve to 0,260  Closed path (already coincident) the point below is basically the same as above, except that the starting point is not the lower left corner, and the start and end point of the closure are not coincident m 0,156c 731,143,307,103,455,77s 836,12,910,0l910 260c 834,260,606,260,455,260s75,260,0,260z Command:m      move to (moveTo)     x,y     start point coordinates z     Closed Path (closepath)      connect the start and end points of the path with a straight line l     line (lineTo)      x,y     current node to specified (x, y) node, straight line connection h     horizontal line     x      keeps the y-coordinate of the current point unchanged, the x-axis moves to x, forming a horizontal line v     vertical lines     y      keeps the x-coordinate of the current point unchanged, the y-axis moves to Y, forming a vertical line c    x1 y1, x2 y2, x y    Brushes Draw a three-time Bezier curve to point (x, y) s    x2 y2, x y a special version of three Bezier curves from "Current Dot x0,y0" ( Omit first control point)


D3.js area function

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.