use of org.jfree.chart.axis.DateAxis in project series-rest-api by 52North.
the class ChartIoHandler method configureTimeAxis.
private void configureTimeAxis(XYPlot plot) {
DateAxis timeAxis = (DateAxis) plot.getDomainAxis();
final Date start = getStartTime(getTimespan());
final Date end = getEndTime(getTimespan());
timeAxis.setRange(start, end);
final Locale locale = i18n.getLocale();
String timeformat = getChartStyleDefinitions().getTimeFormat();
DateFormat requestTimeFormat = new SimpleDateFormat(timeformat, locale);
final DateTimeZone timezone = getTimezone();
requestTimeFormat.setTimeZone(timezone.toTimeZone());
timeAxis.setDateFormatOverride(requestTimeFormat);
timeAxis.setTimeZone(timezone.toTimeZone());
}
use of org.jfree.chart.axis.DateAxis in project cubrid-manager by CUBRID.
the class DbDashboardHistoryViewPart method loadDatabaseChart.
/**
* Load an instance of ChartCompositePart stand for database monitor info
*
* @param parent an instance of Composite
*/
private void loadDatabaseChart(Composite parent) {
dbStatComp = new Composite(parent, SWT.NULL);
dbStatComp.setLayout(new GridLayout());
dbStatComp.setLayoutData(new GridData(GridData.FILL_BOTH));
Group dbGrp = new Group(dbStatComp, SWT.NONE);
dbGrp.setText(Messages.dbDatabaseStatusSeriesGroupName);
GridLayout layoutGrp = new GridLayout();
layoutGrp.verticalSpacing = 0;
layoutGrp.horizontalSpacing = 0;
layoutGrp.marginLeft = 0;
layoutGrp.marginRight = 0;
layoutGrp.marginTop = 0;
layoutGrp.marginBottom = 0;
dbGrp.setLayout(layoutGrp);
GridData gridData = new GridData(GridData.FILL_BOTH);
dbGrp.setLayoutData(gridData);
DbStatDumpData dbStatDumpData = new DbStatDumpData();
TreeMap<String, String> map = convertMapKey(dbStatDumpData.getDiagStatusResultMap());
dbStatChartPart = new ChartCompositePart(dbGrp, map);
for (Map.Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
ShowSetting showSetting = dbStatChartPart.getSettingMap().get(key);
ShowSettingMatching.match(key, showSetting, MonitorType.DATABASE);
}
dbStatChartPart.loadContent();
JFreeChart chart = (JFreeChart) dbStatChartPart.getChart();
chart.setBorderVisible(false);
XYPlot xyplot = (XYPlot) dbStatChartPart.getChart().getPlot();
DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
dateaxis.setFixedAutoRange(300000d);
dateaxis.setLowerMargin(0.0D);
dateaxis.setUpperMargin(0.0D);
dateaxis.setVisible(true);
xyplot.getRangeAxis().setVisible(true);
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
renderer.setURLGenerator(null);
renderer.setBaseToolTipGenerator(null);
}
use of org.jfree.chart.axis.DateAxis in project cubrid-manager by CUBRID.
the class DatabaseDashboardViewPart method loadDatabaseChart.
/**
* Load an instance of ChartCompositePart stand for database monitor info
*
* @param parent an instance of Composite
*/
private void loadDatabaseChart(Composite parent) {
dbStatComp = new Composite(parent, SWT.NULL);
dbStatComp.setLayout(new GridLayout());
dbStatComp.setLayoutData(new GridData(GridData.FILL_BOTH));
Group dbGrp = new Group(dbStatComp, SWT.NONE);
dbGrp.setText(Messages.dbDatabaseStatusSeriesGroupName);
GridLayout layoutGrp = new GridLayout();
layoutGrp.verticalSpacing = 0;
layoutGrp.horizontalSpacing = 0;
layoutGrp.marginLeft = 0;
layoutGrp.marginRight = 0;
layoutGrp.marginTop = 0;
layoutGrp.marginBottom = 0;
dbGrp.setLayout(layoutGrp);
GridData gridData = new GridData(GridData.FILL_BOTH);
dbGrp.setLayoutData(gridData);
DbStatDumpData dbStatDumpData = new DbStatDumpData();
TreeMap<String, String> map = convertMapKey(dbStatDumpData.getDiagStatusResultMap());
dbStatChartPart = new ChartCompositePart(dbGrp, map);
for (Map.Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
ShowSetting showSetting = dbStatChartPart.getSettingMap().get(key);
ShowSettingMatching.match(key, showSetting, MonitorType.DATABASE);
}
dbStatChartPart.loadContent();
JFreeChart chart = (JFreeChart) dbStatChartPart.getChart();
chart.setBorderVisible(false);
XYPlot xyplot = (XYPlot) dbStatChartPart.getChart().getPlot();
DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
dateaxis.setFixedAutoRange(300000d);
dateaxis.setLowerMargin(0.0D);
dateaxis.setUpperMargin(0.0D);
dateaxis.setVisible(false);
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
renderer.setURLGenerator(null);
renderer.setBaseToolTipGenerator(null);
}
use of org.jfree.chart.axis.DateAxis in project cubrid-manager by CUBRID.
the class HostDashboardHistoryViewPart method loadBrokerChart.
/**
* Load an instance of ChartCompositePart stand for broker monitor info
*
* @param parent the instance of Composite
*/
private void loadBrokerChart(Composite parent) {
brokerComp = new Composite(parent, SWT.NULL);
brokerComp.setLayout(new GridLayout());
brokerComp.setLayoutData(new GridData(GridData.FILL_BOTH));
Group brokerGrp = new Group(brokerComp, SWT.NONE);
brokerGrp.setText(Messages.hostBrokerSeriesGroupName);
GridLayout layoutGrp = new GridLayout();
layoutGrp.verticalSpacing = 0;
layoutGrp.horizontalSpacing = 0;
layoutGrp.marginLeft = 0;
layoutGrp.marginRight = 0;
layoutGrp.marginTop = 0;
layoutGrp.marginBottom = 0;
brokerGrp.setLayout(layoutGrp);
GridData gridData = new GridData(GridData.FILL_BOTH);
brokerGrp.setLayoutData(gridData);
BrokerDiagData brokerDiagData = new BrokerDiagData();
TreeMap<String, String> map = convertMapKey(brokerDiagData.getDiagStatusResultMap());
brokerChartPart = new ChartCompositePart(brokerGrp, map);
for (Map.Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
ShowSetting showSetting = brokerChartPart.getSettingMap().get(key);
ShowSettingMatching.match(key, showSetting, MonitorType.BROKER);
}
brokerChartPart.loadContent();
JFreeChart chart = (JFreeChart) brokerChartPart.getChart();
chart.setBorderVisible(false);
XYPlot xyplot = (XYPlot) brokerChartPart.getChart().getPlot();
DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
dateaxis.setFixedAutoRange(300000d);
dateaxis.setLowerMargin(0.0D);
dateaxis.setUpperMargin(0.0D);
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
renderer.setURLGenerator(null);
renderer.setBaseToolTipGenerator(null);
}
use of org.jfree.chart.axis.DateAxis in project jgnash by ccavanaugh.
the class MonthlyAccountBalanceChart method createVerticalXYBarChart.
private JFreeChart createVerticalXYBarChart(Account a) {
DateFormat df = new SimpleDateFormat("MM/yy");
TimeSeriesCollection data = createTimeSeriesCollection(a);
DateAxis dateAxis = new DateAxis(rb.getString("Column.Date"));
dateAxis.setTickUnit(new DateTickUnit(DateTickUnitType.MONTH, 1, df));
dateAxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
// if (a.getTransactionCount() > 0) {
Date start = DateUtils.asDate(DateUtils.getFirstDayOfTheMonth(startDateField.getLocalDate()));
Date end = DateUtils.asDate(DateUtils.getLastDayOfTheMonth(endDateField.getLocalDate()));
dateAxis.setRange(start, end);
// }
NumberAxis valueAxis = new NumberAxis(rb.getString("Column.Balance"));
StandardXYToolTipGenerator tooltipGenerator = new StandardXYToolTipGenerator("{1}, {2}", df, NumberFormat.getNumberInstance());
XYBarRenderer renderer = new XYBarRenderer(0.2);
renderer.setBaseToolTipGenerator(tooltipGenerator);
XYPlot plot = new XYPlot(data, dateAxis, valueAxis, renderer);
String title = rb.getString("Title.AccountBalance") + " - " + a.getPathName();
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, false);
chart.setBackgroundPaint(null);
return chart;
}
Aggregations