code: private void initGraphics() {
          // Set initial size
          if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
              Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
              if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
                  gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
              } else {
                  gauge.setPrefSize(preferredWidth, preferredHeight);
              }
          }
  
          orientation = gauge.getOrientation();
  
          aspectRatio = preferredHeight / preferredWidth;
  
          titleText = new Text(gauge.getTitle());
          titleText.setTextOrigin(VPos.CENTER);
          Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
  
          unitText = new Text(gauge.getUnit());
          unitText.setTextOrigin(VPos.CENTER);
          Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
  
          tickMarkCanvas    = new Canvas(0.79699248 * preferredWidth, 0.08333333 * preferredHeight);
          tickMarksCtx      = tickMarkCanvas.getGraphicsContext2D();
  
          sectionsCanvas    = new Canvas(0.79699248 * preferredWidth, 0.5 * preferredHeight);
          sectionsCtx       = sectionsCanvas.getGraphicsContext2D();
  
          barRect           = new Rectangle();
          Tooltip.install(barRect, barTooltip);
  
          thresholdRect     = new Rectangle();
          Tooltip.install(thresholdRect, thresholdTooltip);
  
          pane = new Pane(titleText,
                          unitText,
                          tickMarkCanvas,
                          sectionsCanvas,
                          barRect,
                          thresholdRect);
          pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth()))));
          pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
  
          getChildren().setAll(pane);
      }
docs: ******************** Initialization ************************************