public synchronized void graph(double[] data, double color) {
//        long time0 = System.nanoTime();
//        System.out.println("WaterfallGraph, graph, start, " + time0);
        if (dataAxisAuto) {
            //minData = Double.POSITIVE_INFINITY;
            //maxData = Double.NEGATIVE_INFINITY;
            for (int i = 0; i < data.length; i++) {
                if (data[i] < minData)
                    minData = data[i];
                if (data[i] > maxData)
                    maxData = data[i];
            }

            if (allTimeMax < maxData)
                allTimeMax = maxData;
            if (allTimeMin > minData)
                allTimeMin = minData;
        }
        
        if (colorAxisAuto) {
            if (color < minColor)
                minColor = color;
            if (color > maxColor)
                maxColor = color;
        }

        this.data.add(scaleData(data));
        this.color.add(scaleColor(color));
    }