我有一個XYLineChart
的問題。我不知道如何將圖表字體設置爲Swing組件。當我使用這個:JFreeChart - 錯誤的圖表字體
chart.setTitle(new TextTitle("Tahoma title, style plain, size 11", new Font("Tahoma", Font.PLAIN, 11)));
它仍然是錯誤的:(
編輯:當我在一個新的幀創建圖表,在標題的字體是好如何設置所有的標籤,軸標題和其他文字相同的字體大小,沒有大膽?
解決:)
public static void changeStyle(JFreeChart chart) {
final StandardChartTheme chartTheme = (StandardChartTheme)StandardChartTheme.createJFreeTheme();
final Font font = new Font("Tahoma", Font.PLAIN, 11);
final Color color = new Color(0, 0, 0);
chartTheme.setExtraLargeFont(font);
chartTheme.setLargeFont(font);
chartTheme.setRegularFont(font);
chartTheme.setSmallFont(font);
chartTheme.setAxisLabelPaint(color);
chartTheme.setLegendItemPaint(color);
chartTheme.setItemLabelPaint(color);
chartTheme.apply(chart);
}
好的,我改變了標題的字體和大小。但如何更改所有項目的字體(標籤,軸...)? – czy 2011-05-25 10:24:00