Witam, mam pewien problem z wstawianiem danych do LineCharta, ktory jest zainicjowany w fxml, próbuje do niego wsadzić dane z poziomu kontrolera i ni cholery nic sie nie chce zmieniac, moze to jakis banalny blad wynikający z mojej niewiedzy jednak prosiłbym o podpowiedź.
Ponizej zamieszczam kod kontrolera i fxml

package application;

import java.net.URL;
import java.util.ResourceBundle;

import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.util.Duration;

public class MainController implements Initializable{

    @FXML private LineChart<Number, Number> lc;
    @FXML private ImageView imgView;
    @FXML private Image img;
    private XYChart.Series<Number,Number> hourDataSeries; 
    private NumberAxis xAxis;
    private Timeline animation;
    private double hours = 0; 
    private double minutes = 0;
    private double timeInHours = 0;
    private double prevY = 10;
    private double y = 10;

    @FXML
    protected void pressClose(ActionEvent event) {
        System.exit(0);
    }
    @FXML
    protected void pressDelete(ActionEvent event) {

        animation.play();
        lc.animatedProperty();

    }
    @Override
    public void initialize(URL arg0, ResourceBundle arg1) {        

        animation = new Timeline();
        animation.getKeyFrames().add(new KeyFrame(Duration.millis(1000 / 60), new    EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent actionEvent) {
                // 6 minutes data per frame
          for(int count=0; count < 6; count++) {
        nextTime();
        plotTime();
          }
        }
        }));
        animation.setCycleCount(Animation.INDEFINITE);

        xAxis = new NumberAxis(0,24,3);
              final NumberAxis yAxis = new NumberAxis(0,100,10);
              lc = new LineChart<Number,Number>(xAxis,yAxis);

              lc.setCreateSymbols(false);
              lc.setAnimated(false);
              lc.setLegendVisible(false);
              lc.setTitle("ACME Company Stock");

              xAxis.setLabel("Time");
              xAxis.setForceZeroInRange(false);
              yAxis.setLabel("Share Price");
              yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis,"$",null));

              hourDataSeries = new XYChart.Series<Number,Number>();
              hourDataSeries.setName("Hourly Data");
              hourDataSeries.getData().add(new XYChart.Data<Number,Number>(timeInHours,prevY));
              lc.getData().add(hourDataSeries);

    }

    private void nextTime() {
        if (minutes == 59) {
            hours ++;
            minutes = 0;
        } else {
            minutes ++;
        }
        timeInHours = hours + ((1d/60d)*minutes);
    }

    private void plotTime() {
        if ((timeInHours % 1) == 0) {
            // change of hour
            double oldY = y;
            y = prevY - 10 + (Math.random()*20);
            prevY = oldY;
            while (y < 10 || y > 90) y = y - 10 + (Math.random()*20);
            hourDataSeries.getData().add(new XYChart.Data<Number, Number>(timeInHours, prevY));
            // after 25hours delete old data
            if (timeInHours > 25) hourDataSeries.getData().remove(0);
            // every hour after 24 move range 1 hour
            if (timeInHours > 24) {
                xAxis.setLowerBound(xAxis.getLowerBound()+1);
                xAxis.setUpperBound(xAxis.getUpperBound()+1);
            }
        }
    }

}

Fxml:

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

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.chart.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>

<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2"
fx:controller="application.MainController">
  <children>
    <MenuBar prefHeight="25.0" prefWidth="600.0" AnchorPane.bottomAnchor="375.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
      <menus>
        <Menu mnemonicParsing="false" text="File">
          <items>
            <MenuItem mnemonicParsing="false" text="Close" onAction="#pressClose" />
          </items>
        </Menu>
        <Menu mnemonicParsing="false" text="Edit">
          <items>
            <MenuItem mnemonicParsing="false" text="Delete" onAction="#pressDelete" />
          </items>
        </Menu>
        <Menu mnemonicParsing="false" text="Help">
          <items>
            <MenuItem mnemonicParsing="false" text="About" />
          </items>
        </Menu>
      </menus>
    </MenuBar>
    <TabPane prefHeight="375.0000999999975" prefWidth="600.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="25.0">
      <tabs>
        <Tab text="Untitled Tab 1">
          <content>
            <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
          </content>
        </Tab>
        <Tab text="Untitled Tab 2">
          <content>
            <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
              <children>
                <ImageView fx:id="imgView" fitHeight="315.5000034122293" fitWidth="420.6666564941406" layoutX="121.0" layoutY="15.0" pickOnBounds="true" preserveRatio="true">
                  <image>
                    <Image fx:id="img" url="file:/C:/Users/adria_000/Downloads/serduszko/1.png" />
                  </image>
                </ImageView>
              </children>
            </AnchorPane>
          </content>
        </Tab>
        <Tab text="Untitled Tab 2">
          <content>
            <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
              <children>
                <LineChart fx:id="lc" layoutX="7.0" layoutY="14.0" prefHeight="330.0" prefWidth="580.0" animated="true">
                  <xAxis><CategoryAxis side="BOTTOM" /></xAxis>
                  <yAxis><NumberAxis side="LEFT" /></yAxis>
                </LineChart>
              </children>
            </AnchorPane>
          </content>
        </Tab>
        <Tab text="Untitled Tab 1">
          <content>
            <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
          </content>
        </Tab>
      </tabs>
    </TabPane>
  </children>
</AnchorPane>