gpt4 book ai didi

org.knowm.xchart.XChartPanel.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 14:20:40 32 4
gpt4 key购买 nike

本文整理了Java中org.knowm.xchart.XChartPanel.<init>()方法的一些代码示例,展示了XChartPanel.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XChartPanel.<init>()方法的具体详情如下:
包路径:org.knowm.xchart.XChartPanel
类名称:XChartPanel
方法名:<init>

XChartPanel.<init>介绍

[英]Constructor
[中]建造师

代码示例

代码示例来源:origin: knowm/XChange

series.setMarker(SeriesMarkers.NONE);
return new XChartPanel(chart);

代码示例来源:origin: knowm/XChange

public XChartPanel<XYChart> buildPanel() throws IOException {
 System.out.println("fetching data...");
 updateData();
 // create chart
 chart =
   new XYChartBuilder()
     .width(800)
     .height(400)
     .title("Real-time Bitcoinium Order Book - BITSTAMP_BTC_USD")
     .xAxisTitle("BTC")
     .yAxisTitle("USD")
     .build();
 // Customize Chart
 chart.getStyler().setLegendPosition(LegendPosition.InsideNE);
 chart.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);
 // add series
 XYSeries series = chart.addSeries(BIDS_SERIES_NAME, xAxisBidData, yAxisBidData);
 series.setMarker(SeriesMarkers.NONE);
 series = chart.addSeries(ASKS_SERIES_NAME, xAxisAskData, yAxisAskData);
 series.setMarker(SeriesMarkers.NONE);
 return new XChartPanel<>(chart);
}

代码示例来源:origin: knowm/XChart

protected void addCharts(JTabbedPane tabbedPane, Map<String, Chart> chartMap) {
 for (Entry<String, Chart> e : chartMap.entrySet()) {
  Chart chart = e.getValue();
  if (chart == null) {
   continue;
  }
  XChartPanel chartPanel = new XChartPanel(chart);
  tabbedPane.addTab(e.getKey(), chartPanel);
 }
}

代码示例来源:origin: knowm/XChart

@Override
 public void run() {
  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  XChartPanel<T> chartPanel = new XChartPanel<T>(charts.get(0));
  chartPanels.add(chartPanel);
  frame.add(chartPanel);
  // Display the window.
  frame.pack();
  frame.setVisible(true);
 }
});

代码示例来源:origin: knowm/XChart

public XChartPanel<BubbleChart> buildPanel() {
 return new XChartPanel<BubbleChart>(getChart());
}

代码示例来源:origin: knowm/XChart

public XChartPanel<XYChart> buildPanel() {
 return new XChartPanel<XYChart>(getChart());
}

代码示例来源:origin: knowm/XChart

@Override
 public void run() {
  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  frame.getContentPane().setLayout(new GridLayout(numRows, numColumns));
  for (T chart : charts) {
   if (chart != null) {
    XChartPanel<T> chartPanel = new XChartPanel<T>(chart);
    chartPanels.add(chartPanel);
    frame.add(chartPanel);
   } else {
    JPanel chartPanel = new JPanel();
    frame.getContentPane().add(chartPanel);
   }
  }
  // Display the window.
  frame.pack();
  frame.setVisible(true);
 }
});

代码示例来源:origin: knowm/XChart

@Override
 public void run() {
  // Create and set up the window.
  JFrame frame = new JFrame("Advanced Example");
  frame.setLayout(new BorderLayout());
  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  // chart
  JPanel chartPanel = new XChartPanel<XYChart>(chart);
  frame.add(chartPanel, BorderLayout.CENTER);
  // label
  JLabel label = new JLabel("Blah blah blah.", SwingConstants.CENTER);
  frame.add(label, BorderLayout.SOUTH);
  // Display the window.
  frame.pack();
  frame.setVisible(true);
 }
});

代码示例来源:origin: knowm/XChart

/**
 * Create the GUI and show it. For thread safety, this method should be invoked from the event
 * dispatch thread.
 */
private static void createAndShowGUI() {
 // Create and set up the window.
 JFrame frame = new JFrame("XChart Swing Demo");
 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 // Add content to the window.
 JPanel chartPanel = new XChartPanel(new AreaChart01().getChart());
 frame.add(chartPanel);
 // Display the window.
 frame.pack();
 frame.setVisible(true);
}

代码示例来源:origin: knowm/XChart

/** Constructor */
public XChartDemo() {
 super(new GridLayout(1, 0));
 // Create the nodes.
 DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts");
 createNodes(top);
 // Create a tree that allows one selection at a time.
 tree = new JTree(top);
 tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 // Listen for when the selection changes.
 tree.addTreeSelectionListener(this);
 // Create the scroll pane and add the tree to it.
 JScrollPane treeView = new JScrollPane(tree);
 // Create Chart Panel
 chartPanel = new XChartPanel(new AreaChart01().getChart());
 // Add the scroll panes to a split pane.
 splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
 splitPane.setTopComponent(treeView);
 splitPane.setBottomComponent(chartPanel);
 Dimension minimumSize = new Dimension(130, 160);
 treeView.setMinimumSize(minimumSize);
 splitPane.setPreferredSize(new Dimension(700, 700));
 // Add the split pane to this panel.
 add(splitPane);
}

代码示例来源:origin: knowm/XChart

ChartInfo chartInfo = (ChartInfo) nodeInfo;
chartPanel = new XChartPanel(chartInfo.getExampleChart());
splitPane.setBottomComponent(chartPanel);

代码示例来源:origin: org.knowm.xchart/xchart

@Override
 public void run() {
  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  XChartPanel<T> chartPanel = new XChartPanel<T>(charts.get(0));
  chartPanels.add(chartPanel);
  frame.add(chartPanel);
  // Display the window.
  frame.pack();
  frame.setVisible(true);
 }
});

代码示例来源:origin: org.knowm.xchart/xchart

@Override
 public void run() {
  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  frame.getContentPane().setLayout(new GridLayout(numRows, numColumns));
  for (T chart : charts) {
   if (chart != null) {
    XChartPanel<T> chartPanel = new XChartPanel<T>(chart);
    chartPanels.add(chartPanel);
    frame.add(chartPanel);
   } else {
    JPanel chartPanel = new JPanel();
    frame.getContentPane().add(chartPanel);
   }
  }
  // Display the window.
  frame.pack();
  frame.setVisible(true);
 }
});

代码示例来源:origin: es.ucm.fdi.gaia/jCOLIBRI

textArea.setText(er.toString());
textArea.setEditable(false);
XChartPanel<XYChart> xcpanel = new XChartPanel<XYChart>(chart);
dialog.getContentPane().add(xcpanel, BorderLayout.CENTER);

代码示例来源:origin: signaflo/java-timeseries

/**
 * Plot a data set. This method will produce a scatter plot of the data values against the integers
 * from 0 to n - 1, where n is the size of the data set.
 *
 * @param dataSet the data set to plot.
 */
public static void plot(final DataSet dataSet) {
  Thread plotThread = new Thread(() -> {
    final double[] indices = new double[dataSet.size()];
    for (int i = 0; i < indices.length; i++) {
      indices[i] = i;
    }
    XYChart chart = new XYChartBuilder().theme(Styler.ChartTheme.GGPlot2).
        title("Scatter Plot").xAxisTitle("Index").yAxisTitle("Values").build();
    chart.getStyler().setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Scatter).
        setChartFontColor(Color.BLACK).setSeriesColors(new Color[]{Color.BLUE});
    chart.addSeries("com/github/signaflo/data", indices, dataSet.asArray());
    JPanel panel = new XChartPanel<>(chart);
    JFrame frame = new JFrame("Data Set");
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
  });
  plotThread.start();
}

代码示例来源:origin: signaflo/java-timeseries

residualSeries.setMarker(new Circle()).setMarkerColor(Color.RED);
JPanel panel = new XChartPanel<>(chart);
JFrame frame = new JFrame(title);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

代码示例来源:origin: signaflo/java-timeseries

/**
 * Plot the first data set against the second data set. The first data set will be plotted on the x-axis, while
 * the second data set will be plotted on the y-axis.
 *
 * @param firstDataSet the data set to plot on the x-axis.
 * @param secondDataSet the data set to plot against the first data set.
 */
public static void plot(final DataSet firstDataSet, final DataSet secondDataSet) {
  Thread plotThread = new Thread(() -> {
    XYChart chart = new XYChartBuilder().theme(Styler.ChartTheme.GGPlot2)
                      .height(600)
                      .width(800)
                      .title("Scatter Plot")
                      .xAxisTitle("X")
                      .yAxisTitle("Y")
                      .build();
    chart.getStyler().setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Scatter).
        setChartFontColor(Color.DARK_GRAY).setSeriesColors(new Color[]{Color.BLUE});
    chart.addSeries("Y against X", firstDataSet.asArray(), secondDataSet.asArray());
    JPanel panel = new XChartPanel<>(chart);
    JFrame frame = new JFrame("Scatter Plot");
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
  });
  plotThread.start();
}

代码示例来源:origin: nroduit/Weasis

private void showDvhChart() {
  RtSet rt = rtSet;
  if (rt != null) {
    List<StructureLayer> structs = getStructureSelection();
    if (!structs.isEmpty()) {
      XYChart dvhChart = new XYChartBuilder().width(800).height(500).title("DVH").xAxisTitle("Dose (cGy)")
        .yAxisTitle("Volume (%)").build();
      dvhChart.getStyler().setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Line);
      for (StructureLayer structureLayer : structs) {
        Structure structure = structureLayer.getStructure();
        Dvh structureDvh = structure.getDvh();
        structureDvh.appendChart(structure, dvhChart);
      }
      JDialog d = new JDialog(WinUtil.getParentWindow(this), "DVH Chart");
      XChartPanel<XYChart> chartPanel = new XChartPanel<>(dvhChart);
      d.getContentPane().add(chartPanel, BorderLayout.CENTER);
      d.pack();
      JMVUtils.showCenterScreen(d);
    }
  }
}

代码示例来源:origin: signaflo/java-timeseries

.setMarker(SeriesMarkers.NONE)
    .setLineStyle(SeriesLines.DASH_DASH);
JPanel panel = new XChartPanel<>(chart);
JFrame frame = new JFrame("Autocorrelation by Lag");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com