import com.imsl.chart.*; import com.imsl.math.CsShape; import java.awt.Color; public class SampleSpline extends JFrameChart { public SampleSpline() { try { Chart chart = getChart(); AxisXY axis = new AxisXY(chart); chart.getLegend().setPaint(true); double x[] = {0, 1, 2, 3, 4, 5, 8, 9, 10}; double y[] = {1.0, 0.8, 2.4, 3.1, 4.5, 5.8, 6.2, 4.9, 3.7}; Data dataMarker = new Data(axis, x, y); dataMarker.setTitle("Data"); dataMarker.setDataType(Data.DATA_TYPE_MARKER); dataMarker.setMarkerType(Data.MARKER_TYPE_FILLED_CIRCLE); CsShape spline = new CsShape(x, y); Data dataSpline = new Data(axis, new ChartSpline(spline), 0., 10.); dataSpline.setTitle("Fit"); dataSpline.setLineColor(Color.blue); } catch (com.imsl.IMSLException e) { e.printStackTrace(); } } public static void main(String argv[]) { new SampleSpline().setVisible(true); } }