In javafx , and more specifically in the linechart there are 2 scales (x and y). I want to insert a complex formula in the names of the scales (instead of phi (t), add, for example, a degree to it). Is it possible? This is what the y scale looks like: enter image description here

1 answer 1

In its pure form, JavaFX does not support this formatting ( WebView exception, when displaying text in HTML format).

But there is a limited set of standard unicode characters that can help you. See symbol table

Example of use:

 import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.text.Text; import javafx.stage.Stage; public class Main extends Application { public void start(Stage primaryStage) { String string = "x\u00B2"; Text text = new Text(string); Label label = new Label(string); GridPane gridPane = new GridPane(); gridPane.addRow(0, new Text("Text:"), text); gridPane.addRow(1, new Text("Label: "), label); primaryStage.setScene(new Scene(gridPane)); primaryStage.show(); } }