line.y()

line.y([y])

If y is specified, sets the y accessor to the specified function or number and returns this line generator. If y is not specified, returns the current y accessor, which defaults to:

1
2
3
function y(d) {
  return d[1];
}

When a line is generated, the y accessor will be invoked for each defined element in the input data array, being passed the element d, the index i, and the array data as three arguments. The default y accessor assumes that the input data are two-element arrays of numbers. See line.x for more information.

doc_D3_Js
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.