# Thread: Why yAxis only display 3 decimals?

1. ## Why yAxis only display 3 decimals?

I can't set more than 3 decimals on Y axis: this is my example code

Java FX Code:
```package javafxapplication2;

import javafx.application.Application;
import javafx.scene.chart.CategoryAxis;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.chart.LineChart;

public class JavaFXApplication2 extends Application {

@Override
public void start(Stage stage) {
stage.setTitle("Lines plot");

final CategoryAxis xAxis = new CategoryAxis();
final NumberAxis yAxis = new NumberAxis(0.53000, 0.53910, 0.001);

final LineChart<String, Number>lineChart = new LineChart<String, Number>(xAxis, yAxis);

//lineChart.setTitle("Stock quotes");
lineChart.setCreateSymbols(false);
lineChart.setAlternativeRowFillVisible(false);

XYChart.Series series1 = new XYChart.Series();
//series1.setName("Stock 1");

Scene scene = new Scene(lineChart, 800, 600);

stage.setScene(scene);
stage.show();

}
public static void main(String[] args) {
launch(args);
}
}```
How to display on Y axis more than 3 decimals?

Thanks

Susie

2. ## Re: Why yAxis only display 3 decimals?

Originally Posted by susieferrari
I can't set more than 3 decimals on Y axis: this is my example code

Java FX Code:
`       final NumberAxis yAxis = new NumberAxis(0.53000, 0.53910, 0.001);`
How to display on Y axis more than 3 decimals?
Java FX Code:
```    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {

@Override
public String toString(Number object) {
return String.format("%6.4f", object);
}
});```
db

3. ## Re: Why yAxis only display 3 decimals?

Thank you very much DarrylBurke!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•