VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-curvemonotoney-method/

⇱ D3.js curveMonotoneY() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js curveMonotoneY() Method

Last Updated : 2 Sep, 2020

The d3.curveMonotoneY interpolator assumes that the data is sorted according to the y coordinates otherwise it sorts the data accordingly. This curve method produces a cubic spline that preserves monotonicity in x, assuming monotonicity in y.

Syntax:

d3.curveMonotoneY()

Parameters: This method does not accept any parameters.

Return Value: This method does not return any value.

Example 1: 

Output:

👁 Image

Example 2: Sorting the unsorted points by the x-axis then rendering the curve.

Output:

👁 Image
Comment
Article Tags:
Article Tags: