JavaFX LineChart NullPointer

时间:2019-02-11 18:34:02

标签: java fxml linechart

我试图将默认数据添加到折线图中,但是我不断收到空指针异常。

我的代码是:

from django.http import HttpResponse

def some_function(request):
    #Code to run
    #More code to run
    return HttpResponse('Return data to ajax call')

我有要初始化的系统,但空指针异常发生在行public class MainController { @FXML private LineChart<Number,Number> chtContrast; . . . private void setContrastChart() throws NullPointerException{ XYChart.Series<Number, Number> series1 = new XYChart.Series<>(); series1.setName("Series 1"); series1.getData().add(new XYChart.Data<>(0, 0)); series1.getData().add(new XYChart.Data<>(255, 255)); chtContrast.getData().add(series1); } }

0 个答案:

没有答案