use of org.jfree.chart.ChartFrame in project Gemma by PavlidisLab.
the class VisualizeDataSetApp method showProfilesBubbleChartView.
public void showProfilesBubbleChartView(String title, double[][] dataMatrix, int numProfiles) {
if (dataMatrix == null)
throw new RuntimeException("dataMatrix cannot be " + null);
JFreeChart chart = ChartFactory.createXYLineChart(title, "Platform", "Expression Value", null, PlotOrientation.VERTICAL, false, false, false);
MatrixSeries series = new MatrixSeries(title, dataMatrix[0].length, dataMatrix.length);
XYPlot plot = chart.getXYPlot();
plot.setDataset(new MatrixSeriesCollection(series));
ChartFrame frame = new ChartFrame(title, chart, true);
this.showWindow(frame);
}
use of org.jfree.chart.ChartFrame in project Gemma by PavlidisLab.
the class VisualizeDataSetApp method showProfilesLineChartView.
public void showProfilesLineChartView(String title, Collection<double[]> dataCol, int numProfiles) {
if (dataCol == null)
throw new RuntimeException("dataCol cannot be " + null);
if (dataCol.size() < numProfiles) {
VisualizeDataSetApp.log.info("Collection smaller than number of elements. Will display first " + VisualizeDataSetApp.DEFAULT_MAX_SIZE + " profiles.");
numProfiles = VisualizeDataSetApp.DEFAULT_MAX_SIZE;
}
XYSeriesCollection xySeriesCollection = new XYSeriesCollection();
Iterator<double[]> iter = dataCol.iterator();
for (int j = 0; j < numProfiles; j++) {
XYSeries series = this.getSeries(j, iter.next());
xySeriesCollection.addSeries(series);
}
JFreeChart chart = ChartFactory.createXYLineChart(title, "Platform", "Expression Value", xySeriesCollection, PlotOrientation.VERTICAL, false, false, false);
chart.addSubtitle(new TextTitle("(Raw data values)", new Font("SansSerif", Font.BOLD, 14)));
// XYPlot plot = chart.getXYPlot();
ChartFrame frame = new ChartFrame(title, chart, true);
this.showWindow(frame);
}
use of org.jfree.chart.ChartFrame in project Java-Matrix-Benchmark by lessthanoptimal.
the class OperationsVersusSizePlot method displayWindow.
public void displayWindow(int width, int height) {
ChartFrame window = new ChartFrame(chart.getTitle().getText(), chart);
window.setMinimumSize(new Dimension(width, height));
window.setPreferredSize(window.getMinimumSize());
window.setVisible(true);
}
use of org.jfree.chart.ChartFrame in project Energieverbrauchssimulator by duschdas2.
the class Diagramm method erzeuge.
/**
* Erzeugt ein Linien Diagramm aus der �bergebenden CSV_Datei
* @param s
* @throws IOException
*/
public static void erzeuge(String s) throws IOException {
Reader reader = Files.newBufferedReader(Paths.get(s));
CSVReader csvReader = new CSVReader(reader, ';');
String[] header = csvReader.readNext();
String[] nextLine;
// Erstellt die Datens�tze f�r den Graphen aus dem Array
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
// Minuten angabe
int c = 1;
while ((nextLine = csvReader.readNext()) != null) {
// f�r jede Zeile ausf�hren
for (int i = 0; i < header.length; i++) {
// f�r jede Spalte(Ger�te) einmal ausf�hren
if (i == 0) {
// Die Occupancy wird aus anschaulichen Gr�nden mal 10 genommen
dataset.addValue(Double.valueOf(nextLine[i]) * 10, header[i], Integer.toString(c));
} else {
dataset.addValue(Double.valueOf(nextLine[i]), header[i], Integer.toString(c));
}
}
// z�hlt die Minuten hoch
c++;
}
// Erstellt den Graphen
JFreeChart chart = ChartFactory.createLineChart("Simulierter Haushalt", "Zeit in Minuten", "Verbrauch in Watt", dataset, PlotOrientation.VERTICAL, true, true, false);
Plot plot = chart.getPlot();
plot.setBackgroundPaint(Color.black);
// Erstellt das Frame zum abbilden des Graphen
ChartFrame frame = new ChartFrame("Diagramm", chart);
frame.pack();
frame.setVisible(true);
}
use of org.jfree.chart.ChartFrame in project Energieverbrauchssimulator by duschdas2.
the class Diagramm method erzeuge2.
public static void erzeuge2(String s) throws IOException {
JFreeChart xylineChart = ChartFactory.createXYLineChart("Simulierter Haushalt", "Zeit in Minuten", "Verbrauch in Watt", erstelleDataset(s), PlotOrientation.VERTICAL, true, true, false);
XYPlot plot = xylineChart.getXYPlot();
plot.setBackgroundPaint(Color.black);
plot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD);
ChartPanel chartPanel = new ChartPanel(xylineChart);
chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
// Erstellt das Frame zum abbilden des Graphen
ChartFrame frame = new ChartFrame("Diagramm", xylineChart);
frame.pack();
frame.setVisible(true);
}
Aggregations