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


Java BarRenderer.setBaseItemLabelsVisible方法代码示例

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


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

示例1: setBarRenderer

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
public static void setBarRenderer(CategoryPlot plot, boolean isShowDataLabels) {

        plot.setNoDataMessage(NO_DATA_MSG);
        plot.setInsets(new RectangleInsets(10, 10, 5, 10));
        BarRenderer renderer = (BarRenderer) plot.getRenderer();
        renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
        renderer.setMaximumBarWidth(0.075);

        if (isShowDataLabels) {
            renderer.setBaseItemLabelsVisible(true);
        }

        setXAixs(plot);
        setYAixs(plot);
    }
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:16,代码来源:ChartUtils.java

示例2: createStackedBarChart

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
 *
 */
protected JFreeChart createStackedBarChart() throws JRException
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createStackedBarChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(CategoryDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false
			);

	configureChart(jfreeChart, getPlot());

	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	//plot.setNoDataMessage("No data to display");
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);

	BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	// Handle the axis formating for the category axis
	configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
			barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
			barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
			barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
			(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
			);

	// Handle the axis formating for the value axis
	configureAxis(categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
			barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
			barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
			barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
			(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
			);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:58,代码来源:SimpleChartTheme.java

示例3: createStackedBarChart

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
 *
 */
protected JFreeChart createStackedBarChart() throws JRException
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createStackedBarChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(CategoryDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false
			);

	configureChart(jfreeChart, getPlot());

	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	//plot.setNoDataMessage("No data to display");
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);

	BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	// Handle the axis formating for the category axis
	configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
			barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
			barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
			barPlot.getOwnCategoryAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
			barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
			barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
			barPlot.getOwnValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:56,代码来源:GenericChartTheme.java

示例4: createGanttChart

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
	//FIXMECHART legend/tooltip/url should come from plot?
	
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createGanttChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(GanttCategoryDataset)getDataset(),
			isShowLegend(),
			true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
			false
			);

	configureChart(jfreeChart, getPlot());
	
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	//plot.setNoDataMessage("No data to display");
	
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the category axis
	configureAxis(
		categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
		barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
		barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
		barPlot.getOwnCategoryAxisLineColor(), false, null, null
		);
	((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the value axis
	configureAxis(
		categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
		barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
		barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
		barPlot.getOwnValueAxisLineColor(), true,
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

	BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:57,代码来源:GenericChartTheme.java

示例5: createGanttChart

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
	//FIXMECHART legend/tooltip/url should come from plot?
	
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createGanttChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(GanttCategoryDataset)getDataset(),
			isShowLegend(),
			true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
			false
			);

	configureChart(jfreeChart, getPlot());
	
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	//plot.setNoDataMessage("No data to display");
	
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	//FIXMETHEME these are useless if the theme settings apply after regardless of these; check all
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the category axis
	configureAxis(
		categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
		barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
		barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
		barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(), 
		(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()), 
		(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
		);

	((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the value axis
	configureAxis(
		categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
		barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
		barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
		barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()), 
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
		);

	BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:62,代码来源:SimpleChartTheme.java


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