Guest User

Untitled

a guest
Dec 14th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public XYChart.Series<String,Double> data(JsonArray ja){
  2. XYChart.Series<String,Double> tempOnChart = new XYChart.Series<>();
  3. Collection<Data<String,Double>> samples = new ArrayList<>(ja.size());
  4. for(int i =0; i < ja.size();i++){
  5. JsonElement k = ja.get(i);
  6. double d = k.getAsJsonObject().get("Temperature").getAsDouble();
  7. System.out.println(d);
  8. XYChart.Data data1 = new XYChart.Data(String.valueOf(i),d);
  9. samples.add(data1);
  10. }
  11. tempOnChart.getData().addAll(samples);
  12. return tempOnChart;
  13. }
Add Comment
Please, Sign In to add comment