SHARE
TWEET

Untitled

a guest Jan 24th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void initUI(String title) {
  2.         XYSeries xySeries1 = arrangePointsOnArea(10, 0, 10, 0, 10);
  3.         XYSeries xySeries2 = arrangePointsOnArea(10, 12, 18, 15, 25);
  4.         XYSeries xySeries3 = arrangePointsOnArea(10, 20, 30, 5, 10);
  5.  
  6.         neuronSeries = new XYSeries("neurons");
  7.         Point neuron1 = getRandomPointFromRange(0, 30, 0, 30);
  8.         neuronSeries.add(neuron1.x, neuron1.y);
  9.         neurons.add(neuron1);
  10.  
  11.         Point neuron2 = getRandomPointFromRange(0, 30, 0, 30);
  12.         neuronSeries.add(neuron2.x, neuron2.y);
  13.         neurons.add(neuron2);
  14.  
  15.         Point neuron3 = getRandomPointFromRange(0, 30, 0, 30);
  16.         neuronSeries.add(neuron3.x, neuron3.y);
  17.         neurons.add(neuron3);
  18.  
  19.         dataset.addSeries(xySeries1);
  20.         dataset.addSeries(xySeries2);
  21.         dataset.addSeries(xySeries3);
  22.        
  23.         dataset.addSeries(neuronSeries);
  24.  
  25.         JFreeChart chart = createChart(dataset, title);
  26.         ChartPanel chartPanel = new ChartPanel(chart);
  27.         chartPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
  28.         chartPanel.setBackground(Color.white);
  29.         add(chartPanel);
  30.  
  31.         pack();
  32.         setTitle("Line chart");
  33.         setLocationRelativeTo(null);
  34.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  35.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top