本文整理匯總了Java中org.jfree.chart.axis.ValueAxis.setVerticalTickLabels方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueAxis.setVerticalTickLabels方法的具體用法?Java ValueAxis.setVerticalTickLabels怎麽用?Java ValueAxis.setVerticalTickLabels使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.axis.ValueAxis
的用法示例。
在下文中一共展示了ValueAxis.setVerticalTickLabels方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updatePlotter
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
@Override
protected void updatePlotter() {
int categoryCount = prepareData();
String maxClassesProperty = ParameterService
.getParameterValue(MainFrame.PROPERTY_RAPIDMINER_GUI_PLOTTER_COLORS_CLASSLIMIT);
int maxClasses = 20;
try {
if (maxClassesProperty != null) {
maxClasses = Integer.parseInt(maxClassesProperty);
}
} catch (NumberFormatException e) {
// LogService.getGlobal().log("Series plotter: cannot parse property 'rapidminer.gui.plotter.colors.classlimit', using maximal 20 different classes.",
// LogService.WARNING);
LogService.getRoot().log(Level.WARNING,
"com.rapidminer.gui.plotter.charts.SeriesChartPlotter.parsing_property_error");
}
boolean createLegend = categoryCount > 0 && categoryCount < maxClasses;
JFreeChart chart = createChart(this.dataset, createLegend);
// set the background color for the chart...
chart.setBackgroundPaint(Color.white);
// domain axis
if (axis[INDEX] >= 0) {
if (!dataTable.isNominal(axis[INDEX])) {
if (dataTable.isDate(axis[INDEX]) || dataTable.isDateTime(axis[INDEX])) {
DateAxis domainAxis = new DateAxis(dataTable.getColumnName(axis[INDEX]));
domainAxis.setTimeZone(Tools.getPreferredTimeZone());
chart.getXYPlot().setDomainAxis(domainAxis);
if (getRangeForDimension(axis[INDEX]) != null) {
domainAxis.setRange(getRangeForDimension(axis[INDEX]));
}
domainAxis.setLabelFont(LABEL_FONT_BOLD);
domainAxis.setTickLabelFont(LABEL_FONT);
domainAxis.setVerticalTickLabels(isLabelRotating());
}
} else {
LinkedHashSet<String> values = new LinkedHashSet<String>();
for (DataTableRow row : dataTable) {
String stringValue = dataTable.mapIndex(axis[INDEX], (int) row.getValue(axis[INDEX]));
if (stringValue.length() > 40) {
stringValue = stringValue.substring(0, 40);
}
values.add(stringValue);
}
ValueAxis categoryAxis = new SymbolAxis(dataTable.getColumnName(axis[INDEX]),
values.toArray(new String[values.size()]));
categoryAxis.setLabelFont(LABEL_FONT_BOLD);
categoryAxis.setTickLabelFont(LABEL_FONT);
categoryAxis.setVerticalTickLabels(isLabelRotating());
chart.getXYPlot().setDomainAxis(categoryAxis);
}
}
// legend settings
LegendTitle legend = chart.getLegend();
if (legend != null) {
legend.setPosition(RectangleEdge.TOP);
legend.setFrame(BlockBorder.NONE);
legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
legend.setItemFont(LABEL_FONT);
}
AbstractChartPanel panel = getPlotterPanel();
if (panel == null) {
panel = createPanel(chart);
} else {
panel.setChart(chart);
}
// ATTENTION: WITHOUT THIS WE GET SEVERE MEMORY LEAKS!!!
panel.getChartRenderingInfo().setEntityCollection(null);
}