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


Java XYPlot.setNoDataMessage方法代码示例

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


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

示例1: setTimeSeriesBarRender

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
public static void setTimeSeriesBarRender(Plot plot, boolean isShowDataLabels) {

        XYPlot xyplot = (XYPlot) plot;
        xyplot.setNoDataMessage(NO_DATA_MSG);

        XYBarRenderer xyRenderer = new XYBarRenderer(0.1D);
        xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());

        if (isShowDataLabels) {
            xyRenderer.setBaseItemLabelsVisible(true);
            xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
        }

        StandardXYToolTipGenerator xyTooltipGenerator = new StandardXYToolTipGenerator("{1}:{2}", new SimpleDateFormat("yyyy-MM-dd"), new DecimalFormat("0"));
        xyRenderer.setBaseToolTipGenerator(xyTooltipGenerator);
        setXY_XAixs(xyplot);
        setXY_YAixs(xyplot);

    }
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:20,代码来源:ChartUtils.java

示例2: createChart

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
private JFreeChart createChart(XYDataset dataset) {

        JFreeChart chart = ChartFactory.createScatterPlot(this.title,
                this.xAxisLabel, this.yAxisLable, dataset, PlotOrientation.VERTICAL, true, true, false);

        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setNoDataMessage("NO DATA");
        XYLineAndShapeRenderer renderer
                = (XYLineAndShapeRenderer) plot.getRenderer();
        renderer.setSeriesOutlinePaint(0, Color.black);
        renderer.setUseOutlinePaint(true);

        NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
        domainAxis.setAutoRangeIncludesZero(false);
        return chart;

    }
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:18,代码来源:ScatterPlot.java

示例3: setTimeSeriesRender

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
public static void setTimeSeriesRender(Plot plot, boolean isShowData, boolean isShapesVisible) {

        XYPlot xyplot = (XYPlot) plot;
        xyplot.setNoDataMessage(NO_DATA_MSG);
        xyplot.setInsets(new RectangleInsets(10, 10, 5, 10));

        XYLineAndShapeRenderer xyRenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();

        xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
        xyRenderer.setBaseShapesVisible(false);
        if (isShowData) {
            xyRenderer.setBaseItemLabelsVisible(true);
            xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
            xyRenderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE1, TextAnchor.BOTTOM_CENTER));
        }
        xyRenderer.setBaseShapesVisible(isShapesVisible);

        DateAxis domainAxis = (DateAxis) xyplot.getDomainAxis();
        domainAxis.setAutoTickUnitSelection(false);
        DateTickUnit dateTickUnit = new DateTickUnit(DateTickUnitType.YEAR, 1, new SimpleDateFormat("yyyy-MM"));
        domainAxis.setTickUnit(dateTickUnit);

        StandardXYToolTipGenerator xyTooltipGenerator = new StandardXYToolTipGenerator("{1}:{2}", new SimpleDateFormat("yyyy-MM-dd"), new DecimalFormat("0"));
        xyRenderer.setBaseToolTipGenerator(xyTooltipGenerator);

        setXY_XAixs(xyplot);
        setXY_YAixs(xyplot);

    }
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:30,代码来源:ChartUtils.java

示例4: createChart

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
public static JFreeChart createChart(XYDataset xydataset, String shou, String shu) {
	JFreeChart jfreechart = ChartFactory.createScatterPlot("Rating and Rating People Distribution", shou, shu,
			xydataset, PlotOrientation.VERTICAL, true, false, false);
	jfreechart.setBackgroundPaint(Color.white);
	jfreechart.setBorderPaint(Color.GREEN);

	XYPlot xyplot = (XYPlot) jfreechart.getPlot();
	xyplot.setNoDataMessage("no data");
	xyplot.setNoDataMessageFont(new Font("微软雅黑", Font.BOLD, 14));
	xyplot.setNoDataMessagePaint(Color.blue);
	xyplot.setBackgroundPaint(Color.lightGray);

	TextTitle textTitle = jfreechart.getTitle();
	textTitle.setFont(new Font("宋体", Font.BOLD, 20));
	LegendTitle legend = jfreechart.getLegend();
	if (legend != null) {
		legend.setItemFont(new Font("宋体", Font.BOLD, 20));
	}

	XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
	renderer.setBaseShapesVisible(true);
	renderer.setDrawOutlines(true);
	renderer.setSeriesOutlinePaint(0, Color.WHITE);  
	renderer.setUseOutlinePaint(true);  
	renderer.setSeriesOutlineStroke(1, new BasicStroke(0.5F));
	xyplot.setRenderer(renderer);

	NumberAxis numberaxis = (NumberAxis) xyplot.getDomainAxis();
	numberaxis.setTickMarkInsideLength(3.0F);  
    numberaxis.setTickMarkOutsideLength(0.0F); 
	numberaxis.setUpperBound(280000);
	numberaxis.setLowerBound(50000);
	
	numberaxis.setAxisLineStroke(new BasicStroke(1.5f));  

	NumberAxis numberaxis1 = (NumberAxis) xyplot.getRangeAxis();
	numberaxis1.setUpperBound(10.0);
	numberaxis1.setLowerBound(5.0);
	
	NumberTickUnit ntu1 = new NumberTickUnit(0.5);
	numberaxis1.setTickUnit(ntu1);
	
	return jfreechart;
}
 
开发者ID:metaotao,项目名称:doubanbook,代码行数:45,代码来源:ScatterPlotChart.java


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