Examples of XChartPanel


Examples of com.xeiam.xchart.XChartPanel

        JComponent container = new JPanel();
        container.setLayout(new BoxLayout(container, BoxLayout.PAGE_AXIS));

        Chart chart = createChart("Cannonball", LegendPosition.InsideNE);
        cannonballTest(chart);
        container.add(new XChartPanel(chart));
       
        container.setBorder(BorderFactory.createLineBorder(Color.black, 1));
        return container;
    }
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

        Chart chart = createChart("PDF", minX, maxX, LegendPosition.InsideNE);
        int i = 0;
        for (RealDistribution d : series) {
            addPDFSeries(chart, d, seriesText[i++], minX, maxX);
        }
        container.add(new XChartPanel(chart));

        chart = createChart("CDF", minX, maxX, LegendPosition.InsideSE);
        i = 0;
        for (RealDistribution d : series) {
            addCDFSeries(chart, d, seriesText[i++], minX, maxX);
        }
        container.add(new XChartPanel(chart));

        container.setBorder(BorderFactory.createLineBorder(Color.black, 1));
        return container;
    }
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

        Chart chart1 = createChart("Voltage", 550, 450, LegendPosition.InsideNE, true);
        Chart chart2 = createChart("Error Covariance", 450, 450, LegendPosition.InsideNE, false);
       
        constantVoltageTest(chart1, chart2);

        container.add(new XChartPanel(chart1));
        container.add(new XChartPanel(chart2));
       
        container.setBorder(BorderFactory.createLineBorder(Color.black, 1));
        return container;
    }
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

    // Interested in the public polling market data feed (no authentication)
    bitcoiniumMarketDataService = (BitcoiniumMarketDataServiceRaw) bitcoiniumExchange.getPollingMarketDataService();

    // Setup the panel
    final XChartPanel chartPanel = buildPanel();
    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {

      @Override
      public void run() {

        // Create and set up the window.
        JFrame frame = new JFrame("XChart");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(chartPanel);

        // Display the window.
        frame.pack();
        frame.setVisible(true);
      }
    });

    // Simulate a data feed
    TimerTask chartUpdaterTask = new TimerTask() {

      @Override
      public void run() {

        try {
          updateData();
          // update chart
          chartPanel.updateSeries(BIDS_SERIES_NAME, xAxisBidData, yAxisBidData);
          chartPanel.updateSeries(ASKS_SERIES_NAME, xAxisAskData, yAxisAskData);
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    };
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

    Series series = chart.addSeries(BIDS_SERIES_NAME, xAxisBidData, yAxisBidData);
    series.setMarker(SeriesMarker.NONE);
    series = chart.addSeries(ASKS_SERIES_NAME, xAxisAskData, yAxisAskData);
    series.setMarker(SeriesMarker.NONE);

    return new XChartPanel(chart);
  }
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

    // Interested in the public polling market data feed (no authentication)
    bitcoiniumMarketDataService = (BitcoiniumMarketDataServiceRaw) bitcoiniumExchange.getPollingMarketDataService();

    // Setup the panel
    final XChartPanel chartPanel = buildPanel();
    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {

      @Override
      public void run() {

        // Create and set up the window.
        JFrame frame = new JFrame("XChart");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(chartPanel);

        // Display the window.
        frame.pack();
        frame.setVisible(true);
      }
    });

    // Simulate a data feed
    TimerTask chartUpdaterTask = new TimerTask() {

      @Override
      public void run() {

        try {
          BitcoiniumTicker bitcoiniumTicker = bitcoiniumMarketDataService.getBitcoiniumTicker(Currencies.BTC, "BITSTAMP_USD");
          System.out.println(bitcoiniumTicker.toString());
          Date timestamp = new Date(bitcoiniumTicker.getTimestamp());
          float price = bitcoiniumTicker.getLast().floatValue();
          if (xAxisData.get(xAxisData.size() - 1).getTime() != timestamp.getTime()) {
            xAxisData.add(timestamp);
            yAxisData.add(price);
            Series series = chartPanel.updateSeries(SERIES_NAME, xAxisData, yAxisData);
            System.out.println(series.getXData());
            System.out.println(series.getYData());
          }
          else {
            System.out.println("No new data.");
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

    // add series
    Series series = chart.addSeries(SERIES_NAME, xAxisData, yAxisData);
    series.setMarker(SeriesMarker.NONE);

    return new XChartPanel(chart);
  }
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

  public static void main(String[] args) {

    // Setup the panel
    final RealtimeChart02 realtimeChart02 = new RealtimeChart02();
    final XChartPanel chartPanel = realtimeChart02.buildPanel();

    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {

      @Override
      public void run() {

        // Create and set up the window.
        JFrame frame = new JFrame("XChart");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(chartPanel);

        // Display the window.
        frame.pack();
        frame.setVisible(true);
      }
    });

    // Simulate a data feed
    TimerTask chartUpdaterTask = new TimerTask() {

      @Override
      public void run() {

        realtimeChart02.updateData();
        chartPanel.updateSeries(SERIES_NAME, realtimeChart02.getxData(), realtimeChart02.getyData());

      }
    };

    Timer timer = new Timer();
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

  }

  public XChartPanel buildPanel() {

    return new XChartPanel(getChart());
  }
View Full Code Here

Examples of com.xeiam.xchart.XChartPanel

  public static void main(String[] args) {

    // Setup the panel
    final RealtimeChart03 realtimeChart03 = new RealtimeChart03();
    final XChartPanel chartPanel = realtimeChart03.buildPanel();

    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {

      @Override
      public void run() {

        // Create and set up the window.
        JFrame frame = new JFrame("XChart");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(chartPanel);

        // Display the window.
        frame.pack();
        frame.setVisible(true);
      }
    });

    // Simulate a data feed
    TimerTask chartUpdaterTask = new TimerTask() {

      @Override
      public void run() {

        realtimeChart03.updateData();
        chartPanel.updateSeries(SERIES_NAME, realtimeChart03.xData, realtimeChart03.getyData(), realtimeChart03.errorBars);

      }
    };

    Timer timer = new Timer();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.