public void addData(int datasetIndex, double x, double y){
		XYSeries series = dataCollection.get(datasetIndex).getSeries(0);
		series.add(x, y);

		if(showCurrentAverage){
			if(markers[datasetIndex] != null){
				plot.removeRangeMarker(markers[datasetIndex]);
			}
			
			pastData[datasetIndex].add(y);

			double average = pastData[datasetIndex].getAverage();
			
			ValueMarker marker = new ValueMarker(average);
			marker.setPaint(Color.black);
			String label = String.format(labelFormat, average);

			marker.setLabel(label);
			marker.setLabelOffset(new RectangleInsets(10, 0, 0, 10));
			marker.setLabelAnchor(RectangleAnchor.RIGHT);

			markers[datasetIndex] = marker;
			plot.addRangeMarker(marker);
		}


	}