• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ShiftedCategoryAxis类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createGraph

import hudson.util.ShiftedCategoryAxis; //导入依赖的package包/类
/**
 * Create graph based on the given dataset and constraints.
 *
 * @return The JFreeChart graph.
 */
protected JFreeChart createGraph() {
    // Create chart.
    JFreeChart chart = ChartFactory.createStackedAreaChart(null, null, yLabel, dataset, PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.WHITE);

    // Create chart legend.
    LegendTitle legend = chart.getLegend();
    legend.setPosition(RectangleEdge.RIGHT);

    // Create chart plot.
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setForegroundAlpha(0.7f);
    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.darkGray);

    // Create domain (x) axis.
    CategoryAxis domain = new ShiftedCategoryAxis(xLabel);
    domain.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);
    domain.setCategoryMargin(0.0);
    plot.setDomainAxis(domain);

    // Create range (y) axis.
    NumberAxis range = (NumberAxis) plot.getRangeAxis();
    range.setAutoRange(true);
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // Create renderer and paint the chart.
    CategoryItemRenderer renderer = plot.getRenderer();
    plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));

    // Set chart colors for sections.
    for (int i = 0; i < colors.length; i++) {
        renderer.setSeriesPaint(i, colors[i]);
    }
    return chart;
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:44,代码来源:AWSDeviceFarmGraph.java


示例2: createGraph

import hudson.util.ShiftedCategoryAxis; //导入依赖的package包/类
/**
 * Create graph based on the given dataset and constraints.
 * @return
 */
protected JFreeChart createGraph() {
    // Create chart.
    JFreeChart chart = ChartFactory.createStackedAreaChart(null, null, yLabel, dataset, PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.WHITE);

    // Create chart legend.
    LegendTitle legend = chart.getLegend();
    legend.setPosition(RectangleEdge.RIGHT);

    // Create chart plot.
    CategoryPlot plot  = (CategoryPlot) chart.getPlot();
    plot.setForegroundAlpha(0.7f);
    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.darkGray);

    // Create domain (x) axis.
    CategoryAxis domain = new ShiftedCategoryAxis(xLabel);
    domain.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);
    domain.setCategoryMargin(0.0);
    plot.setDomainAxis(domain);

    // Create range (y) axis.
    NumberAxis range = (NumberAxis) plot.getRangeAxis();
    range.setAutoRange(true);
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // Create renderer and paint the chart.
    CategoryItemRenderer renderer = plot.getRenderer();
    plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));

    // Set chart colors for sections.
    for (int i=0; i<colors.length; i++) {
        renderer.setSeriesPaint(i, colors[i]);
    }
    return chart;
}
 
开发者ID:jenkinsci,项目名称:appthwack-plugin,代码行数:43,代码来源:AppThwackGraph.java


示例3: createGraph

import hudson.util.ShiftedCategoryAxis; //导入依赖的package包/类
@Override
protected JFreeChart createGraph() {
    int size = results.size();

    final String[] rowKeys = {"Statement Coverage", "Branch Coverage"};
    final String[] columnKeys = new String[size];
    double[][] data = new double[2][size];

    for (int i = 0; i < size; i++) {
        columnKeys[size - i - 1] = "#" + results.get(i).getNum();
        data[0][size - i - 1] = results.get(i).getStatement();
        data[1][size - i - 1] = results.get(i).getCondition();
    }
    final CategoryDataset dataset = DatasetUtilities.createCategoryDataset(rowKeys, columnKeys, data);

    final JFreeChart chart = ChartFactory.createLineChart(
            null, // chart title
            null, // unused
            "%", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, // tooltips
            false // urls
    );

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();

    plot.setBackgroundPaint(Color.WHITE);
    plot.setOutlinePaint(null);
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.black);

    CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
    plot.setDomainAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
    domainAxis.setLowerMargin(0.0);
    domainAxis.setUpperMargin(0.0);
    domainAxis.setCategoryMargin(0.0);

    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setUpperBound(100);
    rangeAxis.setLowerBound(0);
    rangeAxis.setTickUnit(new NumberTickUnit(10));

    final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
    renderer.setBaseStroke(new BasicStroke(2.0f));
    renderer.setSeriesPaint(0, Color.BLUE);
    renderer.setSeriesPaint(1, Color.RED);

    plot.setRenderer(renderer);
    plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));

    return chart;
}
 
开发者ID:shanbin,项目名称:scoverage-plugin,代码行数:59,代码来源:TrendGraph.java


示例4: createGraph

import hudson.util.ShiftedCategoryAxis; //导入依赖的package包/类
@Override
protected JFreeChart createGraph()
{
    DataSetBuilder<Row, NumberOnlyBuildLabel> dataSetBuilder = new DataSetBuilder<Row, NumberOnlyBuildLabel>();
    for (GraphPoint point : points)
    {
        dataSetBuilder.add(point.getConcernDiagnosticsCount(), CONCERN_ROW, new NumberOnlyBuildLabel(point.getBuild()));
        dataSetBuilder.add(point.getWarningDiagnosticsCount(), WARNING_ROW, new NumberOnlyBuildLabel(point.getBuild()));
        dataSetBuilder.add(point.getErrorDiagnosticsCount(), ERROR_ROW, new NumberOnlyBuildLabel(point.getBuild()));
    }

    final JFreeChart chart = ChartFactory.createStackedAreaChart(
        null, // chart title
        null, // category axis label
        "Diagnostics", // value axis label
        dataSetBuilder.build(), // dataset
        PlotOrientation.VERTICAL, // orientation
        false, // include legend
        true, // tooltips
        true // urls
    );

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setOutlinePaint(null);
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.black);
    
    CategoryAxis domainAxis = new ShiftedCategoryAxis("Build Number");
    plot.setDomainAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
    domainAxis.setLowerMargin(0.0);
    domainAxis.setUpperMargin(0.0);
    domainAxis.setCategoryMargin(0.0);
  
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    
    StackedAreaRenderer renderer = new StackedAreaRenderer2();
    plot.setRenderer(renderer);
    renderer.setSeriesPaint(2, RED);
    renderer.setSeriesPaint(1, YELLOW);
    renderer.setSeriesPaint(0, CYAN);

    // crop extra space around the graph
    plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));
    return chart;
}
 
开发者ID:FauxPasApp,项目名称:fauxpas-jenkins-plugin,代码行数:51,代码来源:FauxPasBuildGraph.java


示例5: buildChart

import hudson.util.ShiftedCategoryAxis; //导入依赖的package包/类
public static JFreeChart buildChart(CodeDxBuildAction action,
		int numBuildsInGraph, String statisticsName, Map<String,Color> colors){

	CategoryDataset dataset = buildDataset(action, numBuildsInGraph, statisticsName);

	JFreeChart chart = ChartFactory.createStackedAreaChart(null, null,
			"Findings", dataset,
			PlotOrientation.VERTICAL, true, false, true);

	chart.setBackgroundPaint(Color.white);

	CategoryPlot plot = chart.getCategoryPlot();
	plot.setBackgroundPaint(Color.WHITE);
	plot.setOutlinePaint(null);
	plot.setForegroundAlpha(0.8f);
	plot.setRangeGridlinesVisible(true);
	plot.setRangeGridlinePaint(Color.black);

	CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
	plot.setDomainAxis(domainAxis);
	domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
	domainAxis.setLowerMargin(0.0);
	domainAxis.setUpperMargin(0.0);
	domainAxis.setCategoryMargin(0.0);

	NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
	rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

	// crop extra space around the graph
	plot.setInsets(new RectangleInsets(0, 0, 0, 5.0));


	List rows = dataset.getRowKeys();

	List<Color> colorList = new ArrayList<Color>();

	if(colors != null){

		for(Object row : rows){

			if(colors.containsKey(row.toString())){

				colorList.add(colors.get(row.toString()));
			}
		}
	}

	if(colorList.size() == rows.size()){

		plot.setRenderer(new CodeDxAreaRenderer(colorList));
	}
	else{

		plot.setRenderer(new CodeDxAreaRenderer(null));
	}


	ArrayList<LegendItem> legendItems = new ArrayList<LegendItem>();
	Iterator<LegendItem> itr = plot.getLegendItems().iterator();
	while (itr.hasNext()) {
		legendItems.add(itr.next());
	}
	//Reverse the order
	Collections.sort(legendItems, new Comparator<LegendItem>() {
		public int compare(LegendItem lhs, LegendItem rhs) {
			return rhs.getSeriesKey().compareTo(lhs.getSeriesKey());
		}
	});
	LegendItemCollection newItems = new LegendItemCollection();
	for (LegendItem item : legendItems) {
		newItems.add(item);
	}
	plot.setFixedLegendItems(newItems);

	return chart;
}
 
开发者ID:jenkinsci,项目名称:codedx-plugin,代码行数:77,代码来源:CodeDxChartBuilder.java


示例6: createGraph

import hudson.util.ShiftedCategoryAxis; //导入依赖的package包/类
@Override
protected JFreeChart createGraph() {
    final JFreeChart chart = ChartFactory.createStackedAreaChart(
            null, // chart
            null, // unused
            yLabel, // range axis label
            categoryDataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, // tooltips
            false // urls
    );

    final LegendTitle legend = chart.getLegend();
    legend.setPosition(RectangleEdge.RIGHT);

    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();

    plot.setBackgroundPaint(Color.WHITE);
    plot.setOutlinePaint(null);
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.black);

    CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
    plot.setDomainAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
    domainAxis.setLowerMargin(0.0);
    domainAxis.setUpperMargin(0.0);
    domainAxis.setCategoryMargin(0.0);

    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setLowerBound(0);
    rangeAxis.setAutoRange(true);

    final StackedAreaRenderer renderer = (StackedAreaRenderer) plot.getRenderer();
    renderer.setBaseStroke(new BasicStroke(2.0f));

    // crop extra space around the graph
    plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));

    return chart;
}
 
开发者ID:Perlmint,项目名称:massif-plugin,代码行数:46,代码来源:MassifGraph.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IntrospectedTableMyBatis3SimpleImpl类代码示例发布时间:2022-05-22
下一篇:
Java Stories类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap