Q:

Display identical values in BarChart

Problem is, when filling my barchart(either one) with a list, identical values get drawn over one another and appear as one. Took me quite a while to figure this out. Now I build a hacky workaround by simply looking for duplicates and adding a " " to them. But if you're displaying a list with 100+ entries and theyre all single digit numbers, youre bound to have up to 9 spaces behind each number for example, and that makes formatting all this really hard. Therefore my question: is there any way to instruct the barchart to draw them seperately, or if there is not, is there a better workaround than mine?
    public void updateChart(boolean originalChart, ArrayList<SortingEntry> entries){
    Platform.runLater(() -> {
        ArrayList<SortingEntry> list = Functions.checkForDoubles(entries);
        if(originalChart){
            inputSeries = new XYChart.Series();
            for(SortingEntry entry:list){
                XYChart.Data chartData = new XYChart.Data(entry.getValue(), entry.getValAsLong());
                inputSeries.getData().add(chartData);
            }
            input.getData().clear();
            input.getData().add(inputSeries);
        } else {
            resultSeries = new XYChart.Series();
            for(SortingEntry entry:list){
                XYChart.Data chartData = new XYChart.Data(entry.getValue(), entry.getValAsLong());
                resultSeries.getData().add(chartData);
            }
            result.getData().clear();
            result.getData().add(resultSeries);
        }
        System.out.println();
    });
}

checkForDoubles in Functions:
    public static ArrayList<SortingEntry> checkForDoubles(ArrayList<SortingEntry> list){
    ArrayList<String> doubles = new ArrayList<>();
    for(int i = 0; i < list.size(); i++){
        for(int j = 0; j < list.size(); j++){
            SortingEntry entry = list.get(i);
            if(entry.getValue().equals(list.get(j).getValue()) && !doubles.contains(entry.getValue()) && i != j){
                doubles.add(entry.getValue());
                list.remove(entry);
                entry.setValue(entry.getValue()+" ");
                list.add(entry);
                checkForDoubles(list);
            }
        }
    }
    return list;
}

A:

Unfortunately, this is definition of the chart -- for one X value (entry.getValue()) you have one Y value. If you don't care about X values -- just use index instead:
int i;
for(SortingEntry entry:list){
    XYChart.Data chartData = new XYChart.Data(i++, entry.getValAsLong());
    inputSeries.getData().add(chartData);
}

Otherwise you need to use tricks like that space (Note, there is a zero width space in utf) or write your own Axis implementation.

