本文整理匯總了Java中org.jfree.chart.ChartFactory.setChartTheme方法的典型用法代碼示例。如果您正苦於以下問題:Java ChartFactory.setChartTheme方法的具體用法?Java ChartFactory.setChartTheme怎麽用?Java ChartFactory.setChartTheme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.ChartFactory
的用法示例。
在下文中一共展示了ChartFactory.setChartTheme方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setChartTheme
import org.jfree.chart.ChartFactory; //導入方法依賴的package包/類
public static void setChartTheme() {
StandardChartTheme chartTheme = new StandardChartTheme("CN");
chartTheme.setExtraLargeFont(FONT);
chartTheme.setRegularFont(FONT);
chartTheme.setLargeFont(FONT);
chartTheme.setSmallFont(FONT);
chartTheme.setTitlePaint(new Color(51, 51, 51));
chartTheme.setSubtitlePaint(new Color(85, 85, 85));
chartTheme.setLegendBackgroundPaint(Color.WHITE);
chartTheme.setLegendItemPaint(Color.BLACK);//
chartTheme.setChartBackgroundPaint(Color.WHITE);
Paint[] OUTLINE_PAINT_SEQUENCE = new Paint[]{Color.WHITE};
DefaultDrawingSupplier drawingSupplier = new DefaultDrawingSupplier(CHART_COLORS, CHART_COLORS, OUTLINE_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
chartTheme.setDrawingSupplier(drawingSupplier);
chartTheme.setPlotBackgroundPaint(Color.WHITE);
chartTheme.setPlotOutlinePaint(Color.WHITE);
chartTheme.setLabelLinkPaint(new Color(8, 55, 114));
chartTheme.setLabelLinkStyle(PieLabelLinkStyle.CUBIC_CURVE);
chartTheme.setAxisOffset(new RectangleInsets(5, 12, 5, 12));
chartTheme.setDomainGridlinePaint(new Color(192, 208, 224));
chartTheme.setRangeGridlinePaint(new Color(192, 192, 192));
chartTheme.setBaselinePaint(Color.WHITE);
chartTheme.setCrosshairPaint(Color.BLUE);
chartTheme.setAxisLabelPaint(new Color(51, 51, 51));
chartTheme.setTickLabelPaint(new Color(67, 67, 72));
chartTheme.setBarPainter(new StandardBarPainter());
chartTheme.setXYBarPainter(new StandardXYBarPainter());
chartTheme.setItemLabelPaint(Color.black);
chartTheme.setThermometerPaint(Color.white);
ChartFactory.setChartTheme(chartTheme);
}
示例2: createChart
import org.jfree.chart.ChartFactory; //導入方法依賴的package包/類
private JFreeChart createChart(String chartContent, String title, String yaxisName){
//創建時序圖對象
XYSeries = new XYSeries(chartContent);
XYSeriesCollection xySeriesCollection=new XYSeriesCollection(XYSeries);
// 設置中文主題樣式 解決亂碼
StandardChartTheme chartTheme = new StandardChartTheme("CN");
// 設置標題字體
chartTheme.setExtraLargeFont(font);
// 設置圖例的字體
chartTheme.setRegularFont(font);
// 設置軸向的字體
chartTheme.setLargeFont(font);
chartTheme.setSmallFont(font);
ChartFactory.setChartTheme(chartTheme);
JFreeChart jfreechart = ChartFactory.createXYLineChart(title,"幀數",yaxisName,xySeriesCollection);
XYPlot xyplot = jfreechart.getXYPlot();
//縱坐標設定
ValueAxis valueaxis = xyplot.getDomainAxis();
//自動設置數據軸數據範圍
valueaxis.setAutoRange(true);
//數據軸固定數據範圍 30s
//valueaxis.setFixedAutoRange(100);
valueaxis = xyplot.getRangeAxis();
return jfreechart;
}