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


Java CategoryLabelPositions.STANDARD属性代码示例

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


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

示例1: getCategoryLabelPosition

public static CategoryLabelPositions getCategoryLabelPosition(double angle)
{
	if (angle == 0.0) return CategoryLabelPositions.STANDARD;
	
	if (angle > 0.0 && angle < 1.0) return CategoryLabelPositions.UP_45;
	if (angle >= 1.0) return CategoryLabelPositions.UP_90;
	
	if (angle < 0.0 && angle > -1.0) return CategoryLabelPositions.DOWN_45;
	if (angle <= -1.0) return CategoryLabelPositions.DOWN_90;
	
	return CategoryLabelPositions.STANDARD;
}
 
开发者ID:dr-jts,项目名称:jeql,代码行数:12,代码来源:CategoryChart.java

示例2: createChartFromQuery

/**
 * Creates a JFreeChart based on the current query results produced by the
 * given chart.
 * 
 * @param c
 *            The chart from which to produce a JFreeChart component. Must
 *            not be null.
 * @return A chart based on the data and settings in the given chart, or
 *         null if the given chart is not sufficiently configured (for
 *         example, if its type is not set) or it is currently unable to
 *         produce a result set.
 */
public static JFreeChart createChartFromQuery(Chart c) throws SQLException, QueryInitializationException, InterruptedException {
    logger.debug("Creating JFreeChart for Wabit chart " + c);
    ChartType chartType = c.getType();
    
    if (chartType == null) {
        logger.debug("Returning null (chart's type is not set)");
        return null;
    }
    
    final JFreeChart chart;
    if (chartType.getDatasetType().equals(DatasetType.CATEGORY)) {
    
    	JFreeChart categoryChart = createCategoryChart(c);
        logger.debug("Made a new category chart: " + categoryChart);
        
        if (categoryChart != null && categoryChart.getPlot() instanceof CategoryPlot) {
        	
        	double rotationRads = Math.toRadians(c.getXAxisLabelRotation());
            CategoryLabelPositions clp;
            if (Math.abs(rotationRads) < 0.05) {
                clp = CategoryLabelPositions.STANDARD;
            } else if (rotationRads < 0) {
                clp = CategoryLabelPositions.createUpRotationLabelPositions(-rotationRads);
            } else {
                clp = CategoryLabelPositions.createDownRotationLabelPositions(rotationRads);
            }
        
            CategoryAxis domainAxis = categoryChart.getCategoryPlot().getDomainAxis();
            domainAxis.setMaximumCategoryLabelLines(5);
            domainAxis.setCategoryLabelPositions(clp);
        }
        
        chart = categoryChart;
        
    } else if (chartType.getDatasetType().equals(DatasetType.XY)) {
        
    	JFreeChart xyChart = createXYChart(c);
        logger.debug("Made a new XY chart: " + xyChart);
        chart = xyChart;
    
    } else {
    
    	throw new IllegalStateException(
                "Unknown chart dataset type " + chartType.getDatasetType());
    
    }
    
    if (chart != null) {
    	makeChartNice(chart);
    }
    
    return chart;
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:65,代码来源:ChartSwingUtil.java

示例3: CategoryLabelConfig

public CategoryLabelConfig(Font font, double marginTop, double marginBottom) {
    this(CategoryLabelPositions.STANDARD, font, Color.black, marginTop, marginBottom,
            Border.NONE, null, null, null, false);
}
 
开发者ID:uq-eresearch,项目名称:aorra,代码行数:4,代码来源:AutoSubCategoryAxis.java


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