本文整理匯總了Java中org.jfree.chart.axis.ValueAxis.setAutoRange方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueAxis.setAutoRange方法的具體用法?Java ValueAxis.setAutoRange怎麽用?Java ValueAxis.setAutoRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.axis.ValueAxis
的用法示例。
在下文中一共展示了ValueAxis.setAutoRange方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MultipleChartFactory
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
public MultipleChartFactory(String title, String xAxis) {
super();
String yAxis = title;
XYSeriesCollection dataset = createDataset("Series");
JFreeChart chart = ChartFactory.createXYLineChart("", xAxis, yAxis,
dataset, PlotOrientation.VERTICAL, false, false, false);
chart.setBackgroundPaint(Color.white);
plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
ValueAxis axis = plot.getDomainAxis();
axis.setAutoRange(true);
NumberAxis rangeAxis2 = new NumberAxis("Range Axis 2");
rangeAxis2.setAutoRangeIncludesZero(false);
JPanel content = new JPanel(new BorderLayout());
chartPanel = new ChartPanel(chart);
content.add(chartPanel);
CSVReader fileReader = new CSVReader();
try {
fileReader.read(plotChanelArray);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
示例2: createChart
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的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;
}