I have a Chart which may have null value and also i want Fixing X-Axis Scale (ex.20 point).
and the value binding to Y-Axis (not null value ex.10 value).

[Update]
String [] categories = {"32-11, 33-11, 34-11, 35-11, 36-11, 37-11, 38-11, 39-11, 40-11, 41-11, 42-11, 43-11, 44-11, 45-11, 46-11, 47-11, 48-11, 49-11, 50-11, 51-11"};
LineChart<String, Number> myChart;
CategoryAxis xAxis;
NumberAxis yAxis;
yAxis = new NumberAxis();
xAxis = new CategoryAxis();
xAxis.setCategories(FXCollections.<String>observableArrayList(Arrays.asList(categories)));
xAxis.setAutoRanging(false);
myChart = new LineChart<String, Number>(xAxis,yAxis);
Series<String, Number> aSeries = new Series<String, Number>();
for (int i = 0; i < categories.length; i++) {
aSeries.getData().add(new XYChart.Data(categories[i],"Some Long values and may be null"));
}
myChart.getData().add(aSeries);
- Chart draw Nothing
- //xAxis.setAutoRanging(false); Chart draw but with auto range.
I found solution for my question :
And add one line all thing go right.
Update:
The problem can be solved without changing the CategoryAxis class just added that line to my code: