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


Java CategoryLabelPositions类代码示例

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


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

示例1: createCategoryDomainAxis

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
public static CategoryAxis createCategoryDomainAxis(PlotConfiguration plotConfiguration) {
	CategoryAxis domainAxis = new CategoryAxis(null);
	String label = plotConfiguration.getDomainConfigManager().getLabel();
	if (label == null) {
		label = I18N.getGUILabel("plotter.unnamed_value_label");
	}
	domainAxis.setLabel(label);

	Font axesFont = plotConfiguration.getAxesFont();
	if (axesFont != null) {
		domainAxis.setLabelFont(axesFont);
		domainAxis.setTickLabelFont(axesFont);
	}

	// rotate labels
	if (plotConfiguration.getOrientation() != PlotOrientation.HORIZONTAL) {
		domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2.0d));
	}

	formatAxis(plotConfiguration, domainAxis);
	return domainAxis;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:ChartAxisFactory.java

示例2: testEquals

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
/**
 * Problem equals method.
 */
public void testEquals() {
    CategoryLabelPositions p1 = new CategoryLabelPositions(
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER) 
    );
    CategoryLabelPositions p2 = new CategoryLabelPositions(
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER) 
    );
    assertEquals(p1, p2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:CategoryLabelPositionsTests.java

示例3: testHashCode

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashCode() {
    CategoryLabelPositions p1 = new CategoryLabelPositions(
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER) 
    );
    CategoryLabelPositions p2 = new CategoryLabelPositions(
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER), 
        new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER) 
    );
    assertTrue(p1.equals(p2));
    int h1 = p1.hashCode();
    int h2 = p2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:CategoryLabelPositionsTests.java

示例4: createTestResultsChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
/**
 * Test results chart.
 *
 * @param stats         SortedMap with dates as keys and
 *                      TestStatistics as value.
 * @param categoryLabel - label to place on X axis.
 * @param out           OutputStream to write image to.
 */
public static void createTestResultsChart(final SortedMap stats, final String categoryLabel,
                                          final String dateFormat, final OutputStream out) throws IOException {

  final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
  for (final Iterator iter = stats.entrySet().iterator(); iter.hasNext();) {
    final Map.Entry entry = (Map.Entry) iter.next();
    final Date date = (Date) entry.getKey();
    final TestStatistics tst = (TestStatistics) entry.getValue();
    if (tst.getTotalTests() == 0) continue; // skip no-test values
    final String dateAsString = StringUtils.formatDate(date, dateFormat);
    dataset.addValue(new Integer(tst.getAverageFailedTests()), CAPTION_FAILED_TESTS, dateAsString);
    dataset.addValue(new Integer(tst.getAverageErrorTests()), CAPTION_ERROR_TESTS, dateAsString);
    dataset.addValue(new Integer(tst.getAverageSuccessfulTests()), CAPTION_SUCCESSFUL_TESTS, dateAsString);
  }

  // create the chart object
  createTestsResultsChartHelper(categoryLabel, dataset, out, CategoryLabelPositions.UP_45);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:27,代码来源:StatisticsUtils.java

示例5: getJFreeChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
@Override
public JFreeChart getJFreeChart( String name, PlotOrientation orientation, CategoryLabelPositions labelPositions,
    Map<String, Double> categoryValues )
{
    DefaultCategoryDataset dataSet = new DefaultCategoryDataset();

    for ( Entry<String, Double> entry : categoryValues.entrySet() )
    {
        dataSet.addValue( entry.getValue(), name, entry.getKey() );
    }

    CategoryPlot plot = getCategoryPlot( dataSet, getBarRenderer(), orientation, labelPositions );

    JFreeChart jFreeChart = getBasicJFreeChart( plot );
    jFreeChart.setTitle( name );

    return jFreeChart;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:19,代码来源:DefaultChartService.java

示例6: getStackedAreaChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
private JFreeChart getStackedAreaChart( BaseChart chart, CategoryDataset dataSet )
{
    JFreeChart stackedAreaChart = ChartFactory.createStackedAreaChart( chart.getName(), chart.getDomainAxisLabel(),
        chart.getRangeAxisLabel(), dataSet, PlotOrientation.VERTICAL, !chart.isHideLegend(), false, false );

    setBasicConfig( stackedAreaChart, chart );

    CategoryPlot plot = (CategoryPlot) stackedAreaChart.getPlot();
    plot.setOrientation( PlotOrientation.VERTICAL );
    plot.setRenderer( getStackedAreaRenderer() );

    CategoryAxis xAxis = plot.getDomainAxis();
    xAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_45 );
    xAxis.setLabelFont( LABEL_FONT );

    return stackedAreaChart;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:18,代码来源:DefaultChartService.java

示例7: getStackedBarChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
private JFreeChart getStackedBarChart( BaseChart chart, CategoryDataset dataSet, boolean horizontal )
{
    JFreeChart stackedBarChart = ChartFactory.createStackedBarChart( chart.getName(), chart.getDomainAxisLabel(),
        chart.getRangeAxisLabel(), dataSet, PlotOrientation.VERTICAL, !chart.isHideLegend(), false, false );

    setBasicConfig( stackedBarChart, chart );

    CategoryPlot plot = (CategoryPlot) stackedBarChart.getPlot();
    plot.setOrientation( horizontal ? PlotOrientation.HORIZONTAL : PlotOrientation.VERTICAL );
    plot.setRenderer( getStackedBarRenderer() );

    CategoryAxis xAxis = plot.getDomainAxis();
    xAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_45 );

    return stackedBarChart;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:17,代码来源:DefaultChartService.java

示例8: getOrganisationUnitDistributionChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
@Override
public JFreeChart getOrganisationUnitDistributionChart( OrganisationUnitGroupSet groupSet, OrganisationUnit organisationUnit )
{
    Map<String, Double> categoryValues = new HashMap<>();
    
    Grid grid = getOrganisationUnitDistribution( groupSet, organisationUnit, true );
    
    if ( grid == null || grid.getHeight() != 1 )
    {
        return null;
    }
    
    for ( int i = 1; i < grid.getWidth() - 2; i++ ) // Skip name, none and total column
    {
        categoryValues.put( grid.getHeaders().get( i ).getName(), Double.valueOf( String.valueOf( grid.getRow( 0 ).get( i ) ) ) );
    }
    
    String title = groupSet.getName() + TITLE_SEP + organisationUnit.getName();
    
    JFreeChart chart = chartService.getJFreeChart( title, PlotOrientation.VERTICAL, CategoryLabelPositions.DOWN_45, categoryValues );
    
    return chart;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:24,代码来源:DefaultOrgUnitDistributionService.java

示例9: getStackedBarChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
private JFreeChart getStackedBarChart( BaseChart chart, CategoryDataset dataSet, boolean horizontal )
{
    JFreeChart stackedBarChart = ChartFactory.createStackedBarChart( chart.getName(), chart.getDomainAxisLabel(),
        chart.getRangeAxisLabel(), dataSet, PlotOrientation.VERTICAL, !chart.isHideLegend(), false, false );

    setBasicConfig( stackedBarChart, chart );

    CategoryPlot plot = (CategoryPlot) stackedBarChart.getPlot();
    plot.setOrientation( horizontal ? PlotOrientation.HORIZONTAL : PlotOrientation.VERTICAL );
    plot.setRenderer( getStackedBarRenderer() );

    CategoryAxis xAxis = plot.getDomainAxis();
    xAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_45 );
    
    return stackedBarChart;
}
 
开发者ID:ehatle,项目名称:AgileAlligators,代码行数:17,代码来源:DefaultChartService.java

示例10: createGraph

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
@Override
protected JFreeChart createGraph() {
	final JFreeChart chart = ChartFactory.createLineChart(null, "Build Number #", this.yLabel, this.dataset, PlotOrientation.VERTICAL, true, true, true);
	chart.setBackgroundPaint(Color.WHITE);

	CategoryPlot plot = (CategoryPlot) chart.getPlot();

	CategoryAxis domainAxis = new CategoryAxis();
	domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
	domainAxis.setLowerMargin(0.0);
	domainAxis.setUpperMargin(0.0);
	domainAxis.setCategoryMargin(0.0);

	plot.setDomainAxis(domainAxis);
	plot.setBackgroundPaint(Color.WHITE);

	ValueAxis yAxis = plot.getRangeAxis();
	yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	//yAxis.setRange(0.0, 100.0);

	URLAndTooltipRenderer urlRenderer = new URLAndTooltipRenderer(this.project.getProject());
	ColorPalette.apply(urlRenderer);
	plot.setRenderer(urlRenderer);

	return chart;
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:27,代码来源:Plot.java

示例11: testHashCode

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashCode() {
    CategoryLabelPositions p1 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER));
    CategoryLabelPositions p2 = new CategoryLabelPositions(
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER),
            new CategoryLabelPosition(RA_TOP, TextBlockAnchor.CENTER));
    assertTrue(p1.equals(p2));
    int h1 = p1.hashCode();
    int h2 = p2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:CategoryLabelPositionsTests.java

示例12: configureAxes

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
/** Configures display of domain and range axes */
private void configureAxes(CategoryPlot plot) {
	NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
	rangeAxis.setAutoRangeIncludesZero(includeZero);
	if (integerRange) {
		rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	}
	rangeAxis.setUpperMargin(0.15);
	rangeAxis.setVisible(rangeAxisVisible);

	CategoryAxis domainAxis = plot.getDomainAxis();

	if (orientation == EPlotOrientation.HORIZONTAL) {
		domainAxis
				.setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
		domainAxis.setMaximumCategoryLabelWidthRatio(.5f);
	} else {
		domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
	}

	domainAxis.setVisible(domainAxisVisible);
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:23,代码来源:BarChartCreator.java

示例13: createChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
public Drawable createChart(ADCDataset dataset) {
  final JFreeChart chart = ChartFactory.createBarChart(
      dataset.get(Attribute.TITLE),
      dataset.get(Attribute.X_AXIS_LABEL),
      dataset.get(Attribute.Y_AXIS_LABEL),
      dataset,
      PlotOrientation.VERTICAL,
      true, false, false);
  final CategoryPlot plot = chart.getCategoryPlot();
  plot.setBackgroundPaint(Color.white);
  plot.setDomainGridlinePaint(Color.lightGray);
  plot.setRangeGridlinePaint(Color.lightGray);
  ValueAxis raxis = plot.getRangeAxis();
  raxis.setRange(0, 100.0);
  CategoryAxis cAxis = plot.getDomainAxis();
  cAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
  BarRenderer renderer = (BarRenderer)plot.getRenderer();
  renderer.setSeriesPaint(0, Colors.fromHex("#0AA1D8"));
  renderer.setSeriesPaint(1, Colors.fromHex("#932832"));
  renderer.setSeriesPaint(2, Colors.fromHex("#94BA4D"));
  renderer.setBarPainter(new StandardBarPainter());
  renderer.setItemMargin(0.01);
  return new JFreeChartDrawable(chart, new Dimension(750, 500));
}
 
开发者ID:uq-eresearch,项目名称:aorra,代码行数:25,代码来源:MarineBarChart.java

示例14: createChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
public static Drawable createChart(ADCDataset dataset, Dimension dimension) {
    final JFreeChart chart = ChartFactory.createBarChart(
            dataset.get(Attribute.TITLE),// chart title
            dataset.get(Attribute.X_AXIS_LABEL),// domain axis label
            dataset.get(Attribute.Y_AXIS_LABEL),// range axis label
            dataset,                  // data
            PlotOrientation.VERTICAL, // orientation
            true,                    // include legend
            false,                     // tooltips?
            false                     // URLs?
        );
    chart.setBackgroundPaint(Color.white);
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    final BarRenderer renderer = (BarRenderer)plot.getRenderer();
    Colors.setSeriesPaint(renderer, dataset.get(Attribute.SERIES_COLORS));
    renderer.setItemMargin(0);
    renderer.setBarPainter(new StandardBarPainter());
    final CategoryAxis cAxis = plot.getDomainAxis();
    cAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    chart.getTitle().setFont(cAxis.getLabelFont());
    chart.getLegend().setMargin(2, 60, 2, 20);
    return new JFreeChartDrawable(chart, dimension);
}
 
开发者ID:uq-eresearch,项目名称:aorra,代码行数:27,代码来源:WetlandsRemaing.java

示例15: createChart

import org.jfree.chart.axis.CategoryLabelPositions; //导入依赖的package包/类
public static Drawable createChart(final ADSCDataset dataset, ChartType type,
    Region region, Dimension dimension) {
    JFreeChart chart;
    if(region == Region.GBR) {
        chart = createChart(rearrange(dataset), type);
        CategoryPlot plot = (CategoryPlot)chart.getPlot();
        CategoryAxis cAxis = getSubCategoryAxis(dataset);
        cAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
        cAxis.setLabelFont(plot.getRangeAxis().getLabelFont());
        cAxis.setTickLabelFont(plot.getRangeAxis().getTickLabelFont());
        cAxis.setTickMarksVisible(false);
        cAxis.setLabel(dataset.get(Attribute.X_AXIS_LABEL));
        plot.setDomainAxis(cAxis);
    } else {
        chart = createChart(dataset, type);
    }
    return new JFreeChartDrawable(chart, dimension);
}
 
开发者ID:uq-eresearch,项目名称:aorra,代码行数:19,代码来源:CoralCover.java


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