This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id: # ID of API | |
providerName: admin # Provider name for API [required] | |
apiName: SwaggerPetstore # Name of the API without Spaces(see publisher UI for more) [required] | |
version: 1.0.0 # Version of API(required) | |
description: 'This is a sample server Petstore server.' # Description of API | |
type: HTTP # Type of API {HTTP|WS} [required] | |
context: /v2 # Context of API with a leading slash, CLI tool will append version on import(if you want to put version like /1.0.0/v2 just set context to /{version}/v2 please refer UI for this) [required] | |
tags: # tags for API as a list | |
- pets | |
- petstore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"sync" | |
"time" | |
) | |
type DataEvent struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"sync" | |
"time" | |
) | |
type DataEvent struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"sync" | |
"time" | |
) | |
type Data struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.application.Platform; | |
import javafx.scene.Scene; | |
import javafx.scene.chart.CategoryAxis; | |
import javafx.scene.chart.LineChart; | |
import javafx.scene.chart.NumberAxis; | |
import javafx.scene.chart.XYChart; | |
import javafx.stage.Stage; | |
import java.text.SimpleDateFormat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void stop() throws Exception { | |
super.stop(); | |
scheduledExecutorService.shutdownNow(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is used to display time in HH:mm:ss format | |
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss"); | |
// setup a scheduled executor to periodically put data into the chart | |
ScheduledExecutorService scheduledExecutorService; | |
scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); | |
// put dummy data onto graph per second | |
scheduledExecutorService.scheduleAtFixedRate(() -> { | |
// get a random integer between 0-10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup scene | |
Scene scene = new Scene(lineChart, 800, 600); | |
primaryStage.setScene(scene); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//defining a series to display data | |
XYChart.Series<String, Number> series = new XYChart.Series<>(); | |
series.setName("Data Series"); | |
// add series to chart | |
lineChart.getData().add(series); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//defining the axes | |
final CategoryAxis xAxis = new CategoryAxis(); // we are gonna plot against time | |
final NumberAxis yAxis = new NumberAxis(); | |
xAxis.setLabel("Time/s"); | |
xAxis.setAnimated(false); // axis animations are removed | |
yAxis.setLabel("Value"); | |
yAxis.setAnimated(false); // axis animations are removed | |
//creating the line chart with two axis created above | |
final LineChart<String, Number> lineChart = new LineChart<>(xAxis, yAxis); |