use of org.spf4j.perf.tsdb.TSTable in project spf4j by zolyfarkas.
the class TSDBViewJInternalFrame method addChartToPanel.
private void addChartToPanel(final String tableName, final JPanel content) throws IOException {
TSTable info = tsDb.getTSTable(tableName);
long startTime = ((Date) startDate.getValue()).getTime();
long endTime = ((Date) endDate.getValue()).getTime();
if (TimeSeriesDatabase.canGenerateHeatChart(info)) {
JFreeChart chart = tsDb.createHeatJFreeChart(info.getTableName(), startTime, endTime);
ChartPanel pannel = new ChartPanel(chart);
pannel.setPreferredSize(new Dimension(600, 800));
pannel.setDomainZoomable(false);
pannel.setMouseZoomable(false);
pannel.setRangeZoomable(false);
pannel.setZoomAroundAnchor(false);
pannel.setZoomInFactor(1);
pannel.setZoomOutFactor(1);
content.add(pannel);
}
if (TimeSeriesDatabase.canGenerateMinMaxAvgCount(info)) {
JFreeChart chart = tsDb.createMinMaxAvgJFreeChart(info.getTableName(), startTime, endTime);
ChartPanel pannel = new ChartPanel(chart);
pannel.setPreferredSize(new Dimension(600, 600));
content.add(pannel);
}
if (TimeSeriesDatabase.canGenerateCount(info)) {
JFreeChart chart = tsDb.createCountJFreeChart(info.getTableName(), startTime, endTime);
ChartPanel pannel = new ChartPanel(chart);
pannel.setPreferredSize(new Dimension(600, 600));
content.add(pannel);
} else {
List<JFreeChart> createJFreeCharts = tsDb.createJFreeCharts(info.getTableName(), startTime, endTime);
for (JFreeChart chart : createJFreeCharts) {
ChartPanel pannel = new ChartPanel(chart);
pannel.setPreferredSize(new Dimension(600, 600));
content.add(pannel);
}
}
}
Aggregations