當前位置: 首頁>>代碼示例>>Java>>正文


Java XYZSeries類代碼示例

本文整理匯總了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;
}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:24,代碼來源:ScatterPlot3DFXDemo2.java

示例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;
}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:23,代碼來源:XYZLineChart3DFXDemo1.java

示例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;
}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:18,代碼來源:RangeMarkerFXDemo1.java

示例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;
}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:8,代碼來源:RangeMarkerFXDemo1.java

示例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;
}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:21,代碼來源:XYZBarChart3DFXDemo1.java

示例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;
  }
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:38,代碼來源:XYZLineChart3DFXDemo2.java

示例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();
}
 
開發者ID:musaeed,項目名稱:Prism-gsoc16,代碼行數:39,代碼來源:Graph3D.java

示例8: getXYZSeries

import com.orsoncharts.data.xyz.XYZSeries; //導入依賴的package包/類
public XYZSeries getXYZSeries(){
	return xyzSeries;
}
 
開發者ID:musaeed,項目名稱:Prism-gsoc16,代碼行數:4,代碼來源:SeriesEditorDialog.java

示例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;
}
 
開發者ID:musaeed,項目名稱:Prism-gsoc16,代碼行數:8,代碼來源:Graph3D.java


注:本文中的com.orsoncharts.data.xyz.XYZSeries類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。