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

Java SymbolAxis类代码示例

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

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



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

示例1: createChart

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
protected JFreeChart createChart(XYDataset dataset) {
      SymbolAxis domainAxis = new SymbolAxis("Domain", 
              new String[] {"A", "B", "C", "D"});
      SymbolAxis rangeAxis = new SymbolAxis("Range", 
              new String[] {"V", "X", "Y", "Z"});
      XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
      if (!legendPanelOn) 
      	renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());

      XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
      JFreeChart chart = new JFreeChart(chartTitle, plot);

setXSummary(dataset);

if (legendPanelOn)
      	chart.removeLegend();
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:19,代码来源:SymbolAxisDemo1.java


示例2: applyToValueAxis

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:18,代码来源:StandardChartTheme.java


示例3: applyToValueAxis

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis ({@code null} not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:18,代码来源:StandardChartTheme.java


示例4: createXYSymbolicAxisChart

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
private JFreeChart createXYSymbolicAxisChart(String title, XYDataset dataset) {
 SymbolAxis domainAxis = new SymbolAxis("Domain",
            new String[] {"A", "B", "C", "D"});
    SymbolAxis rangeAxis = new SymbolAxis("Range",
            new String[] {"V", "X", "Y", "Z"});
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
//renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());

    XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
    JFreeChart chart = new JFreeChart("SymbolicAxis Demo 1", plot);

    if (lineCondition.indexOf("noshape")!=-1)
		renderer.setBaseShapesVisible(false);
else  renderer.setBaseShapesVisible(true);

if (lineCondition.indexOf("noline")!=-1)
		renderer.setBaseLinesVisible(false);

if (lineCondition.indexOf("nofill")!=-1){
		renderer.setBaseShapesFilled(false);
		renderer.setBaseFillPaint(Color.white);
		renderer.setDrawOutlines(true);}
 else {
	 renderer.setBaseShapesFilled(true);
	 renderer.setUseFillPaint(false);
	 }

    	renderer.setUseFillPaint(true);
//renderer.setFillPaint(Color.white);

    return chart;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:33,代码来源:ChartGenerator_JTable.java


示例5: updatePlotter

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
@Override
protected void updatePlotter() {
	int categoryCount = prepareData();
	String maxClassesProperty = ParameterService
			.getParameterValue(MainFrame.PROPERTY_RAPIDMINER_GUI_PLOTTER_COLORS_CLASSLIMIT);
	int maxClasses = 20;
	try {
		if (maxClassesProperty != null) {
			maxClasses = Integer.parseInt(maxClassesProperty);
		}
	} catch (NumberFormatException e) {
		// LogService.getGlobal().log("Series plotter: cannot parse property 'rapidminer.gui.plotter.colors.classlimit', using maximal 20 different classes.",
		// LogService.WARNING);
		LogService.getRoot().log(Level.WARNING,
				"com.rapidminer.gui.plotter.charts.SeriesChartPlotter.parsing_property_error");
	}
	boolean createLegend = categoryCount > 0 && categoryCount < maxClasses;

	JFreeChart chart = createChart(this.dataset, createLegend);

	// set the background color for the chart...
	chart.setBackgroundPaint(Color.white);

	// domain axis
	if (axis[INDEX] >= 0) {
		if (!dataTable.isNominal(axis[INDEX])) {
			if (dataTable.isDate(axis[INDEX]) || dataTable.isDateTime(axis[INDEX])) {
				DateAxis domainAxis = new DateAxis(dataTable.getColumnName(axis[INDEX]));
				domainAxis.setTimeZone(Tools.getPreferredTimeZone());
				chart.getXYPlot().setDomainAxis(domainAxis);
				if (getRangeForDimension(axis[INDEX]) != null) {
					domainAxis.setRange(getRangeForDimension(axis[INDEX]));
				}
				domainAxis.setLabelFont(LABEL_FONT_BOLD);
				domainAxis.setTickLabelFont(LABEL_FONT);
				domainAxis.setVerticalTickLabels(isLabelRotating());
			}
		} else {
			LinkedHashSet<String> values = new LinkedHashSet<String>();
			for (DataTableRow row : dataTable) {
				String stringValue = dataTable.mapIndex(axis[INDEX], (int) row.getValue(axis[INDEX]));
				if (stringValue.length() > 40) {
					stringValue = stringValue.substring(0, 40);
				}
				values.add(stringValue);
			}
			ValueAxis categoryAxis = new SymbolAxis(dataTable.getColumnName(axis[INDEX]),
					values.toArray(new String[values.size()]));
			categoryAxis.setLabelFont(LABEL_FONT_BOLD);
			categoryAxis.setTickLabelFont(LABEL_FONT);
			categoryAxis.setVerticalTickLabels(isLabelRotating());
			chart.getXYPlot().setDomainAxis(categoryAxis);
		}
	}

	// legend settings
	LegendTitle legend = chart.getLegend();
	if (legend != null) {
		legend.setPosition(RectangleEdge.TOP);
		legend.setFrame(BlockBorder.NONE);
		legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
		legend.setItemFont(LABEL_FONT);
	}

	AbstractChartPanel panel = getPlotterPanel();
	if (panel == null) {
		panel = createPanel(chart);
	} else {
		panel.setChart(chart);
	}

	// ATTENTION: WITHOUT THIS WE GET SEVERE MEMORY LEAKS!!!
	panel.getChartRenderingInfo().setEntityCollection(null);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:75,代码来源:SeriesChartPlotter.java


示例6: ChartMeds

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
JFreeChart ChartMeds(Integer demographicNo,String patientName, String chartTitle,String[] drugs) {
            MiscUtils.getLogger().debug("In ChartMeds");
            org.jfree.data.time.TimeSeriesCollection dataset = new org.jfree.data.time.TimeSeriesCollection();
            JFreeChart chart = ChartFactory.createTimeSeriesChart(chartTitle, "Days", "MEDS", dataset, true, true, true);

            XYPlot plot = chart.getXYPlot();
//            plot.getDomainAxis().setAutoRange(true);
//            Range rang = plot.getDataRange(plot.getRangeAxis());
//
//            log.debug("LEN " + plot.getDomainAxis().getLowerBound() + " ddd " + plot.getDomainAxis().getUpperMargin() + " eee " + plot.getDomainAxis().getLowerMargin());
//            plot.getDomainAxis().setUpperMargin(plot.getDomainAxis().getUpperMargin()*6);
//            plot.getDomainAxis().setLowerMargin(plot.getDomainAxis().getLowerMargin()*6);
//            plot.getRangeAxis().setUpperMargin(plot.getRangeAxis().getUpperMargin()*1.7);
//
//            plot.getDomainAxis().setUpperMargin(0.9);
//            plot.getDomainAxis().setLowerMargin(0.9);
//            plot.getRangeAxis().setUpperMargin(plot.getRangeAxis().getUpperMargin() * 4);


            XYTaskDataset drugDataset = getDrugDataSet( demographicNo,drugs);

            SymbolAxis yAxis = new SymbolAxis("Meds",  getDrugSymbol(demographicNo,drugs));


            yAxis.setGridBandsVisible(false);
            XYBarRenderer xyrenderer = new XYBarRenderer();
            xyrenderer.setUseYInterval(true);
            xyrenderer.setBarPainter(new StandardXYBarPainter());

            //XYPlot xyplot = new XYPlot(drugDataset, xAxis, yAxis, xyrenderer);
            XYPlot xyplot = new XYPlot(drugDataset, plot.getDomainAxis(), yAxis, xyrenderer);

            xyplot.getDomainAxis().setUpperMargin(0.9);
            xyplot.getDomainAxis().setLowerMargin(0.9);

            CombinedDomainXYPlot cplot = new CombinedDomainXYPlot(new DateAxis("Date/Time"));
            cplot.add(xyplot);

            chart = new JFreeChart(chartTitle,cplot);
            chart.setBackgroundPaint(Color.white);
            return chart;
        }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:43,代码来源:MeasurementGraphAction2.java


示例7: createAxis

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
/** Creates domain axis */
private SymbolAxis createAxis(String label, String[] seriesLabels) {
	SymbolAxis leftLocalSymbolAxis = new SymbolAxis(label, seriesLabels);
	leftLocalSymbolAxis.setGridBandsVisible(false);
	return leftLocalSymbolAxis;
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:7,代码来源:XYGanttChartCreator.java


示例8: updatePlotter

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
@Override
protected void updatePlotter() {
    int categoryCount = prepareData();
    String maxClassesProperty = ParameterService.getParameterValue(MainFrame.PROPERTY_RAPIDMINER_GUI_PLOTTER_COLORS_CLASSLIMIT);
    int maxClasses = 20;
    try {
        if (maxClassesProperty != null)
            maxClasses = Integer.parseInt(maxClassesProperty);
    } catch (NumberFormatException e) {
        //LogService.getGlobal().log("Series plotter: cannot parse property 'rapidminer.gui.plotter.colors.classlimit', using maximal 20 different classes.", LogService.WARNING);
        LogService.getRoot().log(Level.WARNING, "com.rapidminer.gui.plotter.charts.SeriesChartPlotter.parsing_property_error");
    }
    boolean createLegend = categoryCount > 0 && categoryCount < maxClasses;

    JFreeChart chart = createChart(this.dataset, createLegend);

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);

    // domain axis
    if (axis[INDEX] >= 0) {
        if (!dataTable.isNominal(axis[INDEX])) {
            if (dataTable.isDate(axis[INDEX]) || dataTable.isDateTime(axis[INDEX])) {
                DateAxis domainAxis = new DateAxis(dataTable.getColumnName(axis[INDEX]));
                domainAxis.setTimeZone(Tools.getPreferredTimeZone());
                chart.getXYPlot().setDomainAxis(domainAxis);
                if (getRangeForDimension(axis[INDEX]) != null)
                    domainAxis.setRange(getRangeForDimension(axis[INDEX]));
                domainAxis.setLabelFont(LABEL_FONT_BOLD);
                domainAxis.setTickLabelFont(LABEL_FONT);
                domainAxis.setVerticalTickLabels(isLabelRotating());
            }
        } else {
            LinkedHashSet<String> values = new LinkedHashSet<String>();
            for (DataTableRow row : dataTable) {
                String stringValue = dataTable.mapIndex(axis[INDEX], (int) row.getValue(axis[INDEX]));
                if (stringValue.length() > 40)
                    stringValue = stringValue.substring(0, 40);
                values.add(stringValue);
            }
            ValueAxis categoryAxis = new SymbolAxis(dataTable.getColumnName(axis[INDEX]), values.toArray(new String[values.size()]));
            categoryAxis.setLabelFont(LABEL_FONT_BOLD);
            categoryAxis.setTickLabelFont(LABEL_FONT);
            categoryAxis.setVerticalTickLabels(isLabelRotating());
            chart.getXYPlot().setDomainAxis(categoryAxis);
        }
    }

    // legend settings
    LegendTitle legend = chart.getLegend();
    if (legend != null) {
        legend.setPosition(RectangleEdge.TOP);
        legend.setFrame(BlockBorder.NONE);
        legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
        legend.setItemFont(LABEL_FONT);
    }

    AbstractChartPanel panel = getPlotterPanel();
    if (panel == null) {
        panel = createPanel(chart);
    } else {
        panel.setChart(chart);
    }

    // ATTENTION: WITHOUT THIS WE GET SEVERE MEMORY LEAKS!!!
    panel.getChartRenderingInfo().setEntityCollection(null);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:68,代码来源:SeriesChartPlotter.java


示例9: ChartMeds

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
JFreeChart ChartMeds(String demographicNo,String patientName, String chartTitle,String[] drugs) {
            MiscUtils.getLogger().debug("In ChartMeds");
            org.jfree.data.time.TimeSeriesCollection dataset = new org.jfree.data.time.TimeSeriesCollection();
            JFreeChart chart = ChartFactory.createTimeSeriesChart(chartTitle, "Days", "MEDS", dataset, true, true, true);

            XYPlot plot = chart.getXYPlot();
//            plot.getDomainAxis().setAutoRange(true);
//            Range rang = plot.getDataRange(plot.getRangeAxis());
//
//            log.debug("LEN " + plot.getDomainAxis().getLowerBound() + " ddd " + plot.getDomainAxis().getUpperMargin() + " eee " + plot.getDomainAxis().getLowerMargin());
//            plot.getDomainAxis().setUpperMargin(plot.getDomainAxis().getUpperMargin()*6);
//            plot.getDomainAxis().setLowerMargin(plot.getDomainAxis().getLowerMargin()*6);
//            plot.getRangeAxis().setUpperMargin(plot.getRangeAxis().getUpperMargin()*1.7);
//
//            plot.getDomainAxis().setUpperMargin(0.9);
//            plot.getDomainAxis().setLowerMargin(0.9);
//            plot.getRangeAxis().setUpperMargin(plot.getRangeAxis().getUpperMargin() * 4);


            XYTaskDataset drugDataset = getDrugDataSet( demographicNo,drugs);

            SymbolAxis yAxis = new SymbolAxis("Meds",  getDrugSymbol(demographicNo,drugs));


            yAxis.setGridBandsVisible(false);
            XYBarRenderer xyrenderer = new XYBarRenderer();
            xyrenderer.setUseYInterval(true);
            xyrenderer.setBarPainter(new StandardXYBarPainter());

            //XYPlot xyplot = new XYPlot(drugDataset, xAxis, yAxis, xyrenderer);
            XYPlot xyplot = new XYPlot(drugDataset, plot.getDomainAxis(), yAxis, xyrenderer);

            xyplot.getDomainAxis().setUpperMargin(0.9);
            xyplot.getDomainAxis().setLowerMargin(0.9);

            CombinedDomainXYPlot cplot = new CombinedDomainXYPlot(new DateAxis("Date/Time"));
            cplot.add(xyplot);

            chart = new JFreeChart(chartTitle,cplot);
            chart.setBackgroundPaint(Color.white);
            return chart;
        }
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:43,代码来源:MeasurementGraphAction2.java


示例10: generateChart

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
public BufferedImage generateChart(Map<String, List<Double>> data, Map<Integer, String> runToCommit, String yCaption,
								   int width, int height) {
	// create dataset
	YIntervalSeriesCollection dataset = new YIntervalSeriesCollection();
	YIntervalSeries s1 = new YIntervalSeries(yCaption);

	int i = 0;

	for (Integer run : runToCommit.keySet()) {
		String commit = runToCommit.get(run);

		DescriptiveStatistics stats = getStats(data.get(commit));

		double mean = stats.getMean();
		double std = stats.getStandardDeviation();

		s1.add(i++, mean, mean - 1.96 * std, mean + 1.96 * std);

	}

	dataset.addSeries(s1);

	// create chart
	//NumberAxis xAxis = new NumberAxis("Revision number");

	Set<String> strings = data.keySet();
	final String[] stringsArray = new String[strings.size()];

	int k = 0;
	for (String str : strings) {
		stringsArray[k++] = StringUtils.abbreviate(str, 10);
	}
	ValueAxis xAxis = new SymbolAxis("Commits", stringsArray);

	NumberAxis yAxis = new NumberAxis("Cluster processing time (ms)");
	yAxis.setAutoRangeStickyZero(false);
	XYErrorRenderer renderer = new XYErrorRenderer();
	renderer.setBaseLinesVisible(true);
	renderer.setSeriesStroke(0, new BasicStroke(3.0f));
	renderer.setBaseShapesVisible(false);
	renderer.setErrorPaint(Color.blue);
	renderer.setErrorStroke(new BasicStroke(1.0f));
	XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.lightGray);
	plot.setRangeGridlinePaint(Color.lightGray);
	JFreeChart chart = new JFreeChart("Average time to process queued work", plot);
	chart.setBackgroundPaint(Color.white);

	// create output image
	BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
	Graphics2D graphics = image.createGraphics();
	graphics.setBackground(Color.white);
	graphics.clearRect(0, 0, width, height);

	// render
	chart.draw(graphics, new Rectangle2D.Double(0, 0, width, height));

	return image;
}
 
开发者ID:ever-been,项目名称:benchmark-hazelcast3,代码行数:61,代码来源:EvaluatorTask.java


示例11: applyToSymbolAxis

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
/**
 * Applies the attributes for this theme to a {@link SymbolAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToSymbolAxis(SymbolAxis axis) {
    axis.setGridBandPaint(this.gridBandPaint);
    axis.setGridBandAlternatePaint(this.gridBandAlternatePaint);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:10,代码来源:StandardChartTheme.java


示例12: applyToSymbolAxis

import org.jfree.chart.axis.SymbolAxis; //导入依赖的package包/类
/**
 * Applies the attributes for this theme to a {@link SymbolAxis}.
 *
 * @param axis  the axis ({@code null} not permitted).
 */
protected void applyToSymbolAxis(SymbolAxis axis) {
    axis.setGridBandPaint(this.gridBandPaint);
    axis.setGridBandAlternatePaint(this.gridBandAlternatePaint);
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:10,代码来源:StandardChartTheme.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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