ThreeJS how to get the Y value off a spline curve from the X value. Not based on the path however

I’m trying to use a spline curve to make a graph and then reference a Y value based on a given X value. I can get x and y based on where I am on the curve based on the position (length) I’m on the curve shown in the last line of the code here. But this isn’t accurate. What I want is to give an X value to get the Y value from the curve. Is this possible?

const curveEnergy = new THREE.SplineCurve( [
    new THREE.Vector2( 405, 100 ),
    new THREE.Vector2( 450, 50 ),
    new THREE.Vector2( 500, 75 ),
    new THREE.Vector2( 550, 100 ),
    new THREE.Vector2( 600, 0 ),
    new THREE.Vector2( 650, 100 ),
    new THREE.Vector2( 700, 50 ),
    new THREE.Vector2( 750, 25 ),
    new THREE.Vector2( 800, 0 ),
    new THREE.Vector2( 850, 25 ),
    new THREE.Vector2( 900, 250 ),
    new THREE.Vector2( 950, 25 ),
    new THREE.Vector2( 1064, 0 )
 ]);
const pointsEnergy = curveEnergy.getPoints( 1064-405 );  //100 represents the kHz I'll be calculating to give me the Average Power
const geometryEnergy = new THREE.BufferGeometry().setFromPoints( pointsEnergy );
const material = new THREE.LineBasicMaterial( { color: 0xffffff } );
const splineEnergy = new THREE.Line( geometryEnergy, material );
scene.add(splineEnergy);

console.log(pointsEnergy[1064].x);