/** * Applies the data from the graph's template to this chart * * @param data a Vector<DateValueTuple> of measurements that should be used to scale the lines * returned by the template */ private void applyTemplate(Vector data) { if (currentTemplate != null) { Vector lines = currentTemplate.getLines(data); if (lines != null) { Enumeration en = lines.elements(); while (en.hasMoreElements()) { Vector dataPoints = (Vector) en.nextElement(); for (int i = 0; i < dataPoints.size(); i++) { chart.insertItem((LinePointsItem) dataPoints.elementAt(i)); } } chart.startNewLine(); } } }
/** Commits the data line (not the template lines), onto the actual chart widget */ private void applyData() { for (int i = 0; i < chartXPointsArray.length; i++) { chart.insertItem( "", chartYPointsArray[i].intValue(), chartXPointsArray[i].intValue(), 0, 0, 255); } }