src/VirusSpreadSimulator.java
/*
	 * Displays charts in real time.
	 */
Displays charts in real time.
Displays charts in real time .
public void go() {
		chart = QuickChart.getChart("Live Chart of Infections", "Day", "Number of Infected People", "Active Cases", days, infections);
		chart.getStyler().setLegendPosition(LegendPosition.InsideNE);
		chart.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);
		Color [] colors = new Color[1];
		colors[0] = Color.RED;
		chart.getStyler().setSeriesColors(colors);
		chart1 = QuickChart.getChart("Live Chart of Patients", "Day", "Number of Patients", "Patients", days, patients);
		chart1.getStyler().setLegendPosition(LegendPosition.InsideNE);
		chart1.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);
		Color [] colors1 = new Color[1];
		colors1[0] = Color.PINK;
		chart1.getStyler().setSeriesColors(colors1);
		chart2 = QuickChart.getChart("Live Chart of Deaths", "Day", "Number of Deaths", "Deaths", days, deaths);
		chart2.getStyler().setLegendPosition(LegendPosition.InsideNE);
		chart2.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);
		Color [] colors2 = new Color[1];
		colors2[0] = Color.BLACK;
		chart2.getStyler().setSeriesColors(colors2);
		sw = new SwingWrapper<XYChart>(chart);
		sw.displayChart();
		sw1 = new SwingWrapper<XYChart>(chart1);
		sw1.displayChart();
		sw2 = new SwingWrapper<XYChart>(chart2);
		sw2.displayChart();
		mySwingWorker = new MySwingWorker();
		mySwingWorker.execute();
	}
public void go ( ) { chart = QuickChart . getChart ( "Live Chart of Infections" , "Day" , "Number of Infected People" , "Active Cases" , days , infections ) ; chart . getStyler ( ) . setLegendPosition ( LegendPosition . InsideNE ) ; chart . getStyler ( ) . setDefaultSeriesRenderStyle ( XYSeriesRenderStyle . Area ) ; Color [ ] colors = new Color [ 1 ] ; colors [ 0 ] = Color . RED ; chart . getStyler ( ) . setSeriesColors ( colors ) ; chart1 = QuickChart . getChart ( "Live Chart of Patients" , "Day" , "Number of Patients" , "Patients" , days , patients ) ; chart1 . getStyler ( ) . setLegendPosition ( LegendPosition . InsideNE ) ; chart1 . getStyler ( ) . setDefaultSeriesRenderStyle ( XYSeriesRenderStyle . Area ) ; Color [ ] colors1 = new Color [ 1 ] ; colors1 [ 0 ] = Color . PINK ; chart1 . getStyler ( ) . setSeriesColors ( colors1 ) ; chart2 = QuickChart . getChart ( "Live Chart of Deaths" , "Day" , "Number of Deaths" , "Deaths" , days , deaths ) ; chart2 . getStyler ( ) . setLegendPosition ( LegendPosition . InsideNE ) ; chart2 . getStyler ( ) . setDefaultSeriesRenderStyle ( XYSeriesRenderStyle . Area ) ; Color [ ] colors2 = new Color [ 1 ] ; colors2 [ 0 ] = Color . BLACK ; chart2 . getStyler ( ) . setSeriesColors ( colors2 ) ; sw = new SwingWrapper < XYChart > ( chart ) ; sw . displayChart ( ) ; sw1 = new SwingWrapper < XYChart > ( chart1 ) ; sw1 . displayChart ( ) ; sw2 = new SwingWrapper < XYChart > ( chart2 ) ; sw2 . displayChart ( ) ; mySwingWorker = new MySwingWorker ( ) ; mySwingWorker . execute ( ) ; }
Displays charts in real time.
Displays charts in real time .
// Create Chart for number of active cases. // Create Chart for number of patients. // Create Chart for number of deaths. // Display the graph.