本文整理汇总了Java中com.orsoncharts.data.xyz.XYZSeries类的典型用法代码示例。如果您正苦于以下问题:Java XYZSeries类的具体用法?Java XYZSeries怎么用?Java XYZSeries使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XYZSeries类属于com.orsoncharts.data.xyz包,在下文中一共展示了XYZSeries类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataset
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
/**
* Creates a sample dataset (hard-coded for the purpose of keeping the
* demo self-contained - in practice you would normally read your data
* from a file, database or other source).
*
* @return A sample dataset.
*/
public static XYZDataset<String> createDataset() {
XYZSeries<String> s1 = new XYZSeries<>("S1");
for (int i = 0; i < 1000; i++) {
s1.add(Math.random() * 100, Math.pow(10, Math.random() * 5),
Math.random() * 100);
}
XYZSeries<String> s2 = new XYZSeries<>("S2");
for (int i = 0; i < 1000; i++) {
s2.add(Math.random() * 100, Math.random() * 100000,
Math.random() * 100);
}
XYZSeriesCollection<String> dataset = new XYZSeriesCollection<>();
dataset.add(s1);
dataset.add(s2);
return dataset;
}
示例2: createDataset
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
/**
* Creates a sample dataset (hard-coded for the purpose of keeping the
* demo self-contained - in practice you would normally read your data
* from a file, database or other source).
*
* @return A sample dataset.
*/
private static XYZDataset<String> createDataset() {
XYZSeriesCollection<String> dataset = new XYZSeriesCollection<>();
for (int s = 1; s < 24; s++) {
XYZSeries<String> series = new XYZSeries<>("Series " + s);
double y = 1.0;
for (int i = 0; i < 3000; i++) {
y = y * (1.0 + (Math.random() - 0.499) / 10.0);
series.add(i, y, s);
}
dataset.add(series);
}
return dataset;
}
示例3: createDataset
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
/**
* Creates a sample dataset (hard-coded for the purpose of keeping the
* demo self-contained - in practice you would normally read your data
* from a file, database or other source).
*
* @return A sample dataset.
*/
private static XYZDataset<String> createDataset() {
XYZSeries<String> s1 = createRandomSeries("S1", 10);
XYZSeries<String> s2 = createRandomSeries("S2", 50);
XYZSeries<String> s3 = createRandomSeries("S3", 150);
XYZSeriesCollection<String> dataset = new XYZSeriesCollection<>();
dataset.add(s1);
dataset.add(s2);
dataset.add(s3);
return dataset;
}
示例4: createRandomSeries
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
private static XYZSeries<String> createRandomSeries(String name, int count) {
XYZSeries<String> s = new XYZSeries<>(name);
for (int i = 0; i < count; i++) {
s.add(Math.random() * 100, Math.random() / 100, Math.random() * 100);
}
return s;
}
示例5: createDataset
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
/**
* Creates a sample dataset (hard-coded for the purpose of keeping the
* demo self-contained - in practice you would normally read your data
* from a file, database or other source).
*
* @return A sample dataset.
*/
private static XYZDataset<String> createDataset() {
XYZSeries<String> series1 = new XYZSeries<>("Series 1");
series1.add(1.0, 5.0, 1.0);
XYZSeries<String> series2 = new XYZSeries<>("Series 2");
series2.add(2.0, 8.0, 2.0);
XYZSeries<String> series3 = new XYZSeries<>("Series 3");
series3.add(1.0, 10.0, 2.0);
XYZSeriesCollection<String> dataset = new XYZSeriesCollection<>();
dataset.add(series1);
dataset.add(series2);
dataset.add(series3);
return dataset;
}
示例6: createDataset
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
private static XYZDataset<String> createDataset() {
BufferedReader in = new BufferedReader(new InputStreamReader(
XYZLineChart3DFXDemo2.class.getResourceAsStream("fxrates.csv")));
String line;
XYZSeriesCollection<String> dataset = new XYZSeriesCollection<>();
XYZSeries<String> aud = new XYZSeries<>("AUD");
XYZSeries<String> brl = new XYZSeries<>("BRL");
XYZSeries<String> chf = new XYZSeries<>("CHF");
XYZSeries<String> cny = new XYZSeries<>("CNY");
XYZSeries<String> eur = new XYZSeries<>("EUR");
XYZSeries<String> gbp = new XYZSeries<>("GBP");
XYZSeries<String> jpy = new XYZSeries<>("JPY");
try {
line = in.readLine(); // ignore the first line
while ((line = in.readLine()) != null) {
String[] items = line.split(",");
LocalDate d = LocalDate.parse(items[0]);
aud.add(d.toEpochDay(), Double.valueOf(items[2]), 1);
brl.add(d.toEpochDay(), Double.valueOf(items[4]), 2);
chf.add(d.toEpochDay(), Double.valueOf(items[6]), 3);
cny.add(d.toEpochDay(), Double.valueOf(items[8]), 4);
eur.add(d.toEpochDay(), Double.valueOf(items[10]), 5);
gbp.add(d.toEpochDay(), Double.valueOf(items[12]), 6);
jpy.add(d.toEpochDay(), Double.valueOf(items[14]), 7);
}
dataset.add(aud);
dataset.add(brl);
dataset.add(chf);
dataset.add(cny);
dataset.add(eur);
dataset.add(gbp);
dataset.add(jpy);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
return dataset;
}
示例7: plotScatter
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
/**
* Plots the scatter plot with the given series name
* @param seriesName the name of the series to be plotted
*/
public void plotScatter(String seriesName){
seriesScatter = new XYZSeries(seriesName);
for(XYZDataItem item : dataCache){
// copy data cache to our series
seriesScatter.add(item);
}
seriesSettings = new SeriesSettings(this, new SeriesKey());
seriesCollectionScatter.add(seriesScatter);
chart = Chart3DFactory.createScatterChart("", "", seriesCollectionScatter, xLabel, zLabel, yLabel);
plot = (XYZPlot)chart.getPlot();
rendererScatter = (ScatterXYZRenderer)plot.getRenderer();
panel = new Chart3DPanel(chart);
panel.setComponentPopupMenu(graphHandler.getGraphMenu());
dPanel = new DisplayPanel3D(panel, true, false);
panel.addMouseListener(graphHandler);
// make sure there is nothing inside this panel before we add our scatter plot
{
removeAll();
revalidate();
repaint();
}
add(dPanel, BorderLayout.CENTER);
/*update all the settings*/
updateGraph();
displaySettings.updateDisplay();
seriesList.updateSeriesList();
}
示例8: getXYZSeries
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
public XYZSeries getXYZSeries(){
return xyzSeries;
}
示例9: getScatterSeries
import com.orsoncharts.data.xyz.XYZSeries; //导入依赖的package包/类
/**
* Return the series if the current plot is scatter {@code null} otherwise
* @return
*/
public XYZSeries getScatterSeries(){
return this.seriesScatter;
}