1 37 38 package org.jfree.chart.demo; 39 40 import org.jfree.data.AbstractSeriesDataset; 41 import org.jfree.data.XYZDataset; 42 43 49 public class SampleXYZDataset extends AbstractSeriesDataset implements XYZDataset { 50 51 52 private double[] xVal = {2.1, 2.375625, 2.375625, 2.232928726, 2.232928726, 1.860415253, 53 1.840842668, 1.905415253, 2.336029412, 3.8}; 54 55 56 private double[] yVal = {14.168, 11.156, 10.089, 8.884, 8.719, 8.466, 5.489, 57 4.107, 4.101, 25}; 58 59 60 private double[] zVal = {2.45, 2.791285714, 2.791285714, 2.2125, 2.2125, 2.22, 2.1, 2.22, 61 1.64875, 4}; 62 63 68 public int getSeriesCount() { 69 return 1; 70 } 71 72 79 public String getSeriesName(int series) { 80 return "Series 1"; 81 } 82 83 90 public int getItemCount(int series) { 91 return xVal.length; 92 } 93 94 105 public Number getXValue(int series, int item) { 106 return new Double (xVal[item]); 107 } 108 109 117 public Number getYValue(int series, int item) { 118 return new Double (yVal[item]); 119 } 120 121 129 public Number getZValue(int series, int item) { 130 return new Double (zVal[item]); 131 } 132 133 } 134 | Popular Tags |