I need to build a
LineChart<Number,Number>
I had the data stored in
ObservableList<MyData>
MyData
had 4 variable, all of it are int
. Let just say the variable in MyData
are: No1, No2, No3, No4
.
Next, I need to build
LineChart<Number,Number>
and I need only No1
and No2
variable, but I don't know how to take that value from ObservableList
, Now I just use XYChart.Data
to add new data to XYChart.Series
of my LineChart<Number,Number>
like this:
private static XYChart.Series dataLineChart = new XYChart.Series();
public static void updateDataChart(){
dataLineChart.getData().addAll(
new XYChart.Data(3,15),
new XYChart.Data(7,20)
);
}
If only I can take the value from ObservableList
I can just simply use :
private static XYChart.Series dataLineChart = new XYChart.Series();
public static void updateDataChart(){
dataLineChart.getData().addAll(
myObservableList
);
}
Can someone help me with this problem ?