public static void addSeries(LineChart<String, Number> lineChart, Index[] data, String type, DataRange range) {
        //lineChart.getData().addAll(series);

        String labels[] = generateXLabels(data, range);
        double values[] = new double[data.length];
        
        for(int i=0; i < data.length; i++){
            values[i] = data[i].getClose_val();
        }
        
        XYChart.Series s = LinearChartManager.createSeries(type, labels, values);      
        
        lineChart.getData().addAll(s);
    }