奇怪的JavaFX折线图

奇怪的JavaFX折线图,java,javafx,charts,Java,Javafx,Charts,为什么我的JavaFX折线图看起来像这样 该图表是实时生成的FFT幅度谱。大面积的橙色让我困惑,从X=2.4开始的部分看起来很正常。该图表也像散点图一样正常 我的FXML文件: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.chart.*?> <?import javafx.scene.text.*?> <?import javafx.scene.shape.*?> &

为什么我的JavaFX折线图看起来像这样

该图表是实时生成的FFT幅度谱。大面积的橙色让我困惑,从X=2.4开始的部分看起来很正常。该图表也像散点图一样正常

我的FXML文件:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.chart.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.shape.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.ilmoeuro.vocaltrainer.VocalTrainerController">
   <children>
      <Label fx:id="notificationLabel" prefHeight="30.0" text="hi there!" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="33.0">
         <font>
            <Font size="21.0" />
         </font>
      </Label>
      <Circle fx:id="ball" fill="DODGERBLUE" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
      <ChoiceBox fx:id="mixerSelect" layoutX="12.0" layoutY="124.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="30.0" minWidth="-Infinity" prefHeight="30.0" prefWidth="320.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
      <LineChart createSymbols="false" fx:id="spectrum" animated="false" layoutY="69.0" legendVisible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="70.0">
        <xAxis>
          <NumberAxis animated="false" autoRanging="false" side="BOTTOM" tickUnit="0.1" upperBound="3.3" />
        </xAxis>
        <yAxis>
          <NumberAxis animated="false" autoRanging="false" side="LEFT" tickUnit="10" upperBound="100" />
        </yAxis>
      </LineChart>
   </children>
</AnchorPane>

图表看起来是这样的,因为数据集中有一个
X=-Infinity
的数据点:

X = -Infinity, Y = 3.3805163
X = 0.0, Y = 1.7121657
X = 0.30103, Y = 4.8865943
X = 0.47712126, Y = 1.3382618
X = 0.60206, Y = 1.2271155
X = 0.69897, Y = 1.1163772
X = 0.7781513, Y = 1.0468717
X = 0.845098, Y = 0.5678162
X = 0.90309, Y = 1.0233414
X = 0.9542425, Y = 1.9072059
X = 1.0, Y = 0.7724228
X = 1.0413927, Y = 1.6636482
X = 1.0791812, Y = 1.4165919
X = 1.1139433, Y = 1.7763731
X = 1.146128, Y = 1.7522545
X = 1.1760913, Y = 1.5338085
X = 1.20412, Y = 1.5507948
X = 1.230449, Y = 0.91199434
X = 1.2552725, Y = 2.8877275

我将
-Infinity
截断为0,之后图表看起来不错。

你用什么数据填充图表?@DVarga看到我的答案了吗