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


Java TextBlockAnchor.CENTER_LEFT属性代码示例

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


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

示例1: createChart

/**
   * Creates a chart.
   * 
   * @param dataset  the dataset.
   * 
   * @return The chart.
   */
  protected JFreeChart createChart(CategoryDataset dataset) {
      
      JFreeChart chart = ChartFactory.createBarChart3D(
          chartTitle,       // chart title
          domainLabel,                  // domain axis label
          rangeLabel,                     // range axis label
          dataset,                     // data
          PlotOrientation.HORIZONTAL,  // orientation
          !legendPanelOn,                        // include legend
          true,                        // tooltips
          false                        // urls
      );

      CategoryPlot plot = chart.getCategoryPlot();
      plot.setForegroundAlpha(1.0f);

      // left align the category labels...
      CategoryAxis axis = plot.getDomainAxis();
      CategoryLabelPositions p = axis.getCategoryLabelPositions();
      
      CategoryLabelPosition left = new CategoryLabelPosition(
          RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, 
          TextAnchor.CENTER_LEFT, 0.0,
          CategoryLabelWidthType.RANGE, 0.30f
      );
      axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
      
      BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
      return chart;        
  
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:40,代码来源:BarChart3DDemo2.java

示例2: createChart

private JFreeChart createChart(final CategoryDataset dataset, String str) {
    final JFreeChart chart = ChartFactory.createBarChart3D(
        str,                            // chart title
        "Names",                        // domain axis label
        "Values(%)",                       // range axis label
        dataset,                        // data
        PlotOrientation.HORIZONTAL,     // orientation
        true,                           // include legend
        true,                           // tooltips
        false                           // urls
    );

    
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setForegroundAlpha(1.0f);

    // left align the category labels...
    final CategoryAxis axis = plot.getDomainAxis();
    final CategoryLabelPositions p = axis.getCategoryLabelPositions();

    final CategoryLabelPosition left = new CategoryLabelPosition(
        RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
        TextAnchor.CENTER_LEFT, 0.0,
        CategoryLabelWidthType.RANGE, 0.30f
    );
    axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));

    // change the auto tick unit selection to integer units only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setRange(from, to);
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    return chart;
}
 
开发者ID:CoEIA,项目名称:DEM,代码行数:34,代码来源:BarChartPanel.java

示例3: createChart

/**
 * Creates a chart.
 *
 * @param dataset  the dataset.
 *
 * @return The chart.
 */
private JFreeChart createChart(final CategoryDataset dataset) {

    final JFreeChart chart = ChartFactory.createBarChart3D(
        "3D Bar Chart Demo 2",       // chart title
        "Category",                  // domain axis label
        "Value",                     // range axis label
        dataset,                     // data
        PlotOrientation.HORIZONTAL,  // orientation
        true,                        // include legend
        true,                        // tooltips
        false                        // urls
    );

    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setForegroundAlpha(1.0f);

    // left align the category labels...
    final CategoryAxis axis = plot.getDomainAxis();
    final CategoryLabelPositions p = axis.getCategoryLabelPositions();

    final CategoryLabelPosition left = new CategoryLabelPosition(
        RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
        TextAnchor.CENTER_LEFT, 0.0,
        CategoryLabelWidthType.RANGE, 0.30f
    );
    axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));

    return chart;

}
 
开发者ID:josejamilena,项目名称:pfc-jose,代码行数:37,代码来源:BarChart3DDemo2.java


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