当前位置: 首页>>代码示例>>Java>>正文


Java DateAxis.setTickLabelsVisible方法代码示例

本文整理汇总了Java中org.jfree.chart.axis.DateAxis.setTickLabelsVisible方法的典型用法代码示例。如果您正苦于以下问题:Java DateAxis.setTickLabelsVisible方法的具体用法?Java DateAxis.setTickLabelsVisible怎么用?Java DateAxis.setTickLabelsVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.axis.DateAxis的用法示例。


在下文中一共展示了DateAxis.setTickLabelsVisible方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TimeSeriesViewObserver

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * 构造分时图的全部元素
 */
public TimeSeriesViewObserver() {
	timeSeriesPrice = new TimeSeries("分时图", Hour.class);
	timeSeriesPrice.add(new Hour(count++, day), StockSubject.OPENING_PRICE);
	timeSeriesPrice.setMaximumItemAge(MAXIMUM_ITEM_AGE);

	TimeSeriesCollection timeseriescollection = new TimeSeriesCollection();
	timeseriescollection.addSeries(timeSeriesPrice);
	DateAxis dateaxis = new DateAxis("时间");
	NumberAxis numberaxis = new NumberAxis("股票价格");
	dateaxis.setTickLabelFont(new Font("微软雅黑", 0, 12));
	numberaxis.setTickLabelFont(new Font("微软雅黑", 0, 12));
	dateaxis.setLabelFont(new Font("微软雅黑", 0, 12));
	numberaxis.setLabelFont(new Font("微软雅黑", 0, 12));

	XYLineAndShapeRenderer xylineandshaperenderer = new XYLineAndShapeRenderer(true, false);
	xylineandshaperenderer.setSeriesPaint(0, Color.red);
	xylineandshaperenderer.setSeriesStroke(0, new BasicStroke(1F, 0, 1));

	XYPlot xyplot = new XYPlot(timeseriescollection, dateaxis, numberaxis, xylineandshaperenderer);
	xyplot.setAxisOffset(new RectangleInsets(0D, 0D, 0D, 0D));
	dateaxis.setAutoRange(true);
	dateaxis.setLowerMargin(0.0D);
	dateaxis.setUpperMargin(0.0D);
	dateaxis.setTickLabelsVisible(true);
	numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

	JFreeChart chart = new JFreeChart("中国铁通股票", new Font("微软雅黑", 1, 12), xyplot, true);
	chartPanel = new ChartPanel(chart);
}
 
开发者ID:Sinton,项目名称:DesignPatterns,代码行数:33,代码来源:TimeSeriesViewObserver.java

示例2: DataChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public DataChart(ComponentRegistry registry, String title, String yaxis) {
    DateAxis domain = new DateAxis("Time");
    NumberAxis range = new NumberAxis(yaxis);
    XYPlot xyplot = new XYPlot();
    xyplot.setDomainAxis(domain);
    xyplot.setRangeAxis(range);
 // xyplot.setBackgroundPaint(Color.black);
    xyplot.setDataset(dataset = new TimeSeriesCollection());

    DefaultXYItemRenderer renderer = new DefaultXYItemRenderer();
    renderer.setSeriesPaint(0, Color.red);
    renderer.setSeriesPaint(1, Color.green);
    renderer.setSeriesPaint(2, Color.blue);
    renderer.setSeriesPaint(3, Color.black);
//    renderer.setBaseStroke(
//        new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)
//    );
    renderer.setSeriesShapesVisible(0, false);
    renderer.setSeriesShapesVisible(1, false);
    renderer.setSeriesShapesVisible(2, false);
    renderer.setSeriesShapesVisible(3, false);
    xyplot.setRenderer(renderer);

    domain.setAutoRange(true);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);

    domain.setTickLabelsVisible(true);
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    JFreeChart chart = new JFreeChart(title,
        JFreeChart.DEFAULT_TITLE_FONT, xyplot, true);
    ChartPanel chartPanel = new ChartPanel(chart);
    setLayout(new BorderLayout());
    setPreferredSize(new Dimension(400, 200));
    add(chartPanel, BorderLayout.CENTER);
  }
 
开发者ID:PERSISTLab,项目名称:BatterylessSim,代码行数:37,代码来源:DataChart.java

示例3: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
protected void createChart(String domainAxisTitle, String rangeAxisTitle, String chartsTitle, boolean includeLegend) {
    DateAxis domain = new DateAxis(domainAxisTitle);
    NumberAxis range = new NumberAxis(rangeAxisTitle);

    XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
    renderer.setSeriesPaint(0, Color.red);
    renderer.setSeriesPaint(1, Color.green);
    renderer.setSeriesPaint(2, Color.blue);
    renderer.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));

    XYPlot plot = new XYPlot(dataset, domain, range, renderer);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

    domain.setAutoRange(true);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);
    domain.setTickLabelsVisible(true);

    range.setAutoRange(false);
    range.setUpperBound(180);
    range.setLowerBound(-180);
    range.setAutoRangeIncludesZero(true);
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    chart = new JFreeChart(plot);
    chart.setBackgroundPaint(Color.white);
}
 
开发者ID:YangMann,项目名称:drone-slam,代码行数:31,代码来源:AttitudeChart.java

示例4: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
protected void createChart(String domainAxisTitle, String rangeAxisTitle, String chartsTitle, boolean includeLegend) {
        DateAxis domain = new DateAxis(domainAxisTitle);
        NumberAxis range = new NumberAxis(rangeAxisTitle);

        XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
        renderer.setSeriesPaint(0, Color.blue);
        renderer.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));

        XYPlot plot = new XYPlot(dataset, domain, range, renderer);
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
        plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

        domain.setAutoRange(true);
        domain.setLowerMargin(0.0);
        domain.setUpperMargin(0.0);
        domain.setTickLabelsVisible(true);

        range.setAutoRange(true);
//		range.setUpperBound(180);
//		range.setLowerBound(0);
        range.setAutoRangeIncludesZero(true);
        range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        chart = new JFreeChart(plot);
        chart.setBackgroundPaint(Color.white);
    }
 
开发者ID:YangMann,项目名称:drone-slam,代码行数:29,代码来源:AltitudeChart.java

示例5: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected void createChart(String domainAxisTitle, String rangeAxisTitle, String chartsTitle, boolean includeLegend) 
{
	DateAxis domain = new DateAxis(domainAxisTitle);
	NumberAxis range = new NumberAxis(rangeAxisTitle);
	
	XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
	renderer.setSeriesPaint(0, Color.red);
	renderer.setSeriesPaint(1, Color.green);
	renderer.setSeriesPaint(2, Color.blue);
	renderer.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
	
	XYPlot plot = new XYPlot(dataset, domain, range, renderer);
	plot.setBackgroundPaint(Color.lightGray);
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
	
	domain.setAutoRange(true);
	domain.setLowerMargin(0.0);
	domain.setUpperMargin(0.0);
	domain.setTickLabelsVisible(true);
	
	range.setAutoRange(false);
	range.setUpperBound(90);
	range.setLowerBound(-90);
	range.setAutoRangeIncludesZero(true);
	range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	
	chart = new JFreeChart(plot);
	chart.setBackgroundPaint(Color.white);
   }
 
开发者ID:Jupre,项目名称:MarmaraDrone,代码行数:33,代码来源:AttitudeChart.java

示例6: NetworkDynamicLineChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
	public NetworkDynamicLineChart(int maxAge,String titleName, String hostIP){
		super(titleName, hostIP);

		this.netBindWidth = new TimeSeries("当前已使用的带宽");
		this.netBindWidth.setMaximumItemAge(maxAge);
		
		TimeSeriesCollection dataset = new TimeSeriesCollection();
		dataset.addSeries(netBindWidth);
		
		DateAxis domain = new DateAxis("时间");
		NumberAxis range = new NumberAxis("带宽/Mbps");

		domain.setTickLabelFont(this.tickFont);
		range.setTickLabelFont(this.tickFont);
		domain.setLabelFont(this.labelFont);
		range.setLabelFont(this.labelFont);
		range.setRange(0.0, 65);
//		range.setTickUnit(new NumberTickUnit(5));//设置刻度线间隔
		
		XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
		renderer.setSeriesPaint(0, Color.red);
		renderer.setSeriesPaint(1, Color.blue);
		renderer.setStroke(new BasicStroke(1.5f, BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL));
		
		XYPlot plot = new XYPlot(dataset, domain, range, renderer);
		plot.setBackgroundPaint(Color.lightGray);
		plot.setDomainGridlinePaint(Color.white);
		plot.setRangeGridlinePaint(Color.white);
		plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
		domain.setAutoRange(true);
		domain.setLowerMargin(0.0);
		domain.setUpperMargin(0.0);
		domain.setTickLabelsVisible(true);
		
		range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
//		Font titleFont = new Font("SansSerif", Font.BOLD, 14);
		JFreeChart chart = new JFreeChart(this.titleName, this.titleFont, plot, true);
		
		chart.getLegend().setItemFont(this.legendFont);	//设置图例字体
		
		chart.setBackgroundPaint(Color.white);
		chartPanel = new ChartPanel(chart);
		chartPanel.setBorder(BorderFactory.createCompoundBorder(
				BorderFactory.createEmptyBorder(4, 4, 4, 4),
				BorderFactory.createLineBorder(Color.black)));
	}
 
开发者ID:uestc-lsu,项目名称:LPCM,代码行数:48,代码来源:NetworkDynamicLineChart.java

示例7: CpuDynamicLineChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
	public CpuDynamicLineChart(int maxAge, String titleName, String hostIP){
//		super.setLayout(null);//使用空布局
		super(titleName, hostIP);
//		super(titleName, hostIP, false);
//		super(titleName, hostIP, 0);
		
		this.cpuUsage = new TimeSeries("cpu使用率");
		this.cpuUsage.setMaximumItemAge(maxAge);
		
		TimeSeriesCollection dataset = new TimeSeriesCollection();
		dataset.addSeries(cpuUsage);
		
		DateAxis domain = new DateAxis("时间");
		NumberAxis range = new NumberAxis("CPU使用率/%");
		
		domain.setTickLabelFont(this.tickFont);
		range.setTickLabelFont(this.tickFont);
		domain.setLabelFont(this.labelFont);
		range.setLabelFont(this.labelFont);
		range.setRange(0.0, 100.0);
		range.setTickUnit(new NumberTickUnit(5));//设置刻度线间隔
		
		XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
		renderer.setSeriesPaint(0, Color.red);
		renderer.setSeriesPaint(1, Color.blue);
//		renderer.setSeriesShape(WIDTH, 20);
		renderer.setStroke(new BasicStroke(1.5f, BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL));
		
		XYPlot plot = new XYPlot(dataset, domain, range, renderer);
		plot.setBackgroundPaint(Color.lightGray);
		plot.setDomainGridlinePaint(Color.white);
		plot.setRangeGridlinePaint(Color.white);
		plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
		
		domain.setAutoRange(true);
		domain.setLowerMargin(0.0);
		domain.setUpperMargin(0.0);
		domain.setTickLabelsVisible(true);
		
		range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
		JFreeChart chart = new JFreeChart(this.titleName, this.titleFont, plot, true);
		
		chart.getLegend().setItemFont(this.legendFont);	//设置图例字体
		
		chart.setBackgroundPaint(Color.white);
		chartPanel = new ChartPanel(chart);
		chartPanel.setBorder(BorderFactory.createCompoundBorder(
				BorderFactory.createEmptyBorder(4, 4, 4, 4),
				BorderFactory.createLineBorder(Color.black)));
	}
 
开发者ID:uestc-lsu,项目名称:LPCM,代码行数:52,代码来源:CpuDynamicLineChart.java

示例8: MemoryDynamicLineChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public MemoryDynamicLineChart(int maxAge,String titleName, String hostIP){
	super(titleName, hostIP);
	
	this.totalMemory = new TimeSeries("总内存");
	this.totalMemory.setMaximumItemAge(maxAge);
	this.freeMemory = new TimeSeries("剩余内存");
	this.freeMemory.setMaximumItemAge(maxAge);
	
	TimeSeriesCollection dataset = new TimeSeriesCollection();
	dataset.addSeries(totalMemory);
	dataset.addSeries(freeMemory);

	DateAxis domain = new DateAxis("时间");
	NumberAxis range = new NumberAxis("内存使用情况/GB");
	
	domain.setTickLabelFont(this.tickFont);
	range.setTickUnit(new NumberTickUnit(0.3f));//设置刻度
	
	range.setTickLabelFont(this.tickFont);
	domain.setLabelFont(this.labelFont);
	range.setLabelFont(this.labelFont);
	
	XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
	renderer.setSeriesPaint(0, Color.red);
	renderer.setSeriesPaint(1, Color.blue);
	renderer.setStroke(new BasicStroke(1.5f, BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL));
	
	XYPlot plot = new XYPlot(dataset, domain, range, renderer);

	plot.setBackgroundPaint(Color.lightGray);
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
	domain.setAutoRange(true);
	domain.setLowerMargin(0.0);
	domain.setUpperMargin(0.0);
	domain.setTickLabelsVisible(true);		
	
	range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	chart = new JFreeChart(this.titleName, this.titleFont, plot, true);
	
	chart.getLegend().setItemFont(this.legendFont);	//设置图例字体
	
	chart.setBackgroundPaint(Color.white);
	chartPanel = new ChartPanel(chart);
	chartPanel.setBorder(BorderFactory.createCompoundBorder(
			BorderFactory.createEmptyBorder(4, 4, 4, 4),
			BorderFactory.createLineBorder(Color.black)));
}
 
开发者ID:uestc-lsu,项目名称:LPCM,代码行数:51,代码来源:MemoryDynamicLineChart.java

示例9: MemoryUsagePanel

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * Creates a new application.
 * 
 * @param historyCount
 *            the history count (in milliseconds).
 */
public MemoryUsagePanel(int historyCount, int interval)
{
	super(new BorderLayout());
	// create two series that automatically discard data more than 30
	// seconds old...
	this.total = new TimeSeries("Total Memory", Millisecond.class);
	this.total.setMaximumItemCount(historyCount);
	this.free = new TimeSeries("Free Memory", Millisecond.class);
	this.free.setMaximumItemCount(historyCount);
	this.used = new TimeSeries("Used Memory", Millisecond.class);
	this.used.setMaximumItemCount(historyCount);
	this.max = new TimeSeries("Used Memory", Millisecond.class);
	this.max.setMaximumItemCount(historyCount);
	TimeSeriesCollection dataset = new TimeSeriesCollection();
	dataset.addSeries(this.total);
	dataset.addSeries(this.free);
	dataset.addSeries(this.used);
	dataset.addSeries(this.max);

	DateAxis domain = new DateAxis("Time");
	NumberAxis range = new NumberAxis("Memory");

	domain.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
	range.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
	domain.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));

	range.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
	XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
	renderer.setSeriesPaint(0, Color.red);
	renderer.setSeriesPaint(1, Color.green);
	renderer.setSeriesPaint(2, Color.black);

	renderer.setStroke(new BasicStroke(1f, BasicStroke.CAP_BUTT,
			BasicStroke.JOIN_BEVEL));
	XYPlot plot = new XYPlot(dataset, domain, range, renderer);
	plot.setBackgroundPaint(Color.lightGray);
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
	domain.setAutoRange(true);
	domain.setLowerMargin(0.0);
	domain.setUpperMargin(0.0);
	domain.setTickLabelsVisible(true);
	range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	JFreeChart chart = new JFreeChart("JVM Memory Usage", new Font(
			"SansSerif", Font.BOLD, 24), plot, true);
	chart.setBackgroundPaint(Color.white);
	ChartPanel chartPanel = new ChartPanel(chart);
	chartPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory
			.createEmptyBorder(4, 4, 4, 4), BorderFactory
			.createLineBorder(Color.black)));
	add(chartPanel);

	gen = new DataGenerator(interval);

}
 
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:63,代码来源:MemoryUsagePanel.java

示例10: createGraph

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * Ugly code creating the graph, layer and all that stuff
 */
private void createGraph() {
	//graphedValues = new TimeSeries(item.getUnit());
	//graphedValues = new TimeSeries(item.getUnit(), Second.class);
	//graphedValues.setMaximumItemAge(3000);
	//graphedValues.setMaximumItemCount(30); 

	dataset= new TimeSeriesCollection();
	
	//dataset.addSeries(this.graphedValues);
	dataset.addSeries(graphedValues);
	DateAxis domain = new DateAxis("Time");
	NumberAxis range = new NumberAxis(item.getUnit());
	//range.setRange(item.getMinValue(), item.getMaxValue());
	range.setAutoRange(true);
	
	domain.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
	range.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
	domain.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
	range.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
	
	XYItemRenderer renderer = new XYLineAndShapeRenderer(true,true);
	renderer.setSeriesPaint(0, Color.RED);
	//renderer.setSeriesPaint(1, Color.GREEN);
	renderer.setBaseStroke(new BasicStroke(3f, BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL));

	  
	XYPlot plot = new XYPlot(dataset, domain, range, renderer);
	plot.setBackgroundPaint(Color.lightGray);
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
	
	domain.setAutoRange(true);
	domain.setLowerMargin(0.0);
	domain.setUpperMargin(0.0);
	domain.setTickLabelsVisible(true);
	range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	
	JFreeChart chart = new JFreeChart("(Id: " + item.getItemId() + ")",
									 new Font("SansSerif",Font.BOLD, 24),
									 plot,
									 true);
	
	//List<String> subtitles = new List<String>();
	//subtitles.add("(on " + device.getName() + ")");
	//chart.setSubtitles(subtitles);
	chart.setBackgroundPaint(Color.white);
	chartPanel = new ChartPanel(chart);
	chartPanel.setBorder(BorderFactory.createCompoundBorder(
										BorderFactory.createEmptyBorder(4, 4, 4, 4),
										BorderFactory.createLineBorder(Color.black)));
	chartPanel.setSize(new Dimension(400, 400));
	chartPanel.addChartMouseListener(new ChartMouseListener(){
	    public void chartMouseClicked(ChartMouseEvent e){
	    	try{
	    	XYItemEntity xyitem=(XYItemEntity) e.getEntity();
	        double x = dataset.getXValue(xyitem.getSeriesIndex(), xyitem.getItem());
	        double y = dataset.getYValue(xyitem.getSeriesIndex(), xyitem.getItem());
	        JOptionPane.showMessageDialog(new JFrame(), ""+y+"  ::  "+new Second(new Date((long)x)));
	    	}
	    	catch(Exception exception )
	    	{
	    	}
	    	
			    }

		public void chartMouseMoved(ChartMouseEvent arg0) {
		
		}
	});

	
}
 
开发者ID:EclipseETS,项目名称:eclipse-telemetry,代码行数:77,代码来源:TelemetryGraph.java


注:本文中的org.jfree.chart.axis.DateAxis.setTickLabelsVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。