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


Java JRChartDataset类代码示例

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


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

示例1: writeXyBarChart

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
 *
 */
public void writeXyBarChart(JRChart chart) throws IOException
{
	writer.startElement(JRXmlConstants.ELEMENT_xyBarChart, getNamespace());

	writeChart(chart);
	JRChartDataset dataset = chart.getDataset();

	if( dataset.getDatasetType() == JRChartDataset.TIMESERIES_DATASET ){
		writeTimeSeriesDataset( (JRTimeSeriesDataset)dataset );
	}
	else if( dataset.getDatasetType() == JRChartDataset.TIMEPERIOD_DATASET ){
		writeTimePeriodDataset( (JRTimePeriodDataset)dataset );
	}
	else if( dataset.getDatasetType() == JRChartDataset.XY_DATASET ){
		writeXyDataset( (JRXyDataset)dataset );
	}

	writeBarPlot((JRBarPlot) chart.getPlot());

	writer.closeElement();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:JRXmlWriter.java

示例2: writeXyBarChart

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
 *
 */
public void writeXyBarChart( JRChart chart, String chartName)
{
	if(chart != null)
	{
		write( "JRDesignChart " + chartName + " = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_XYBAR);\n");
		writeChart( chart, chartName);
		JRChartDataset dataset = chart.getDataset();

		if( dataset.getDatasetType() == JRChartDataset.TIMESERIES_DATASET )
		{
			writeTimeSeriesDataset( (JRTimeSeriesDataset)dataset, chartName, "TimeSeriesDataset");
		}
		else if( dataset.getDatasetType() == JRChartDataset.TIMEPERIOD_DATASET ){
			writeTimePeriodDataset( (JRTimePeriodDataset)dataset, chartName, "XyDataset");
		}
		else if( dataset.getDatasetType() == JRChartDataset.XY_DATASET ){
			writeXyDataset( (JRXyDataset) chart.getDataset(), chartName, "XyDataset");
		}
		writeBarPlot( (JRBarPlot) chart.getPlot(), chartName);
		flush();
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:JRApiWriter.java

示例3: verifyChart

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
private void verifyChart(JRChart chart)
{
	verifyReportElement(chart);
	
	if (chart.getEvaluationTimeValue() == EvaluationTimeEnum.AUTO)
	{
		addBrokenRule("Charts do not support Auto evaluation time.", chart);
	}

	JRChartDataset dataset = chart.getDataset();
	if (dataset == null)
	{
		addBrokenRule("Chart dataset missing.", chart);
	}
	else
	{
		dataset.validate(this);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:JRVerifier.java

示例4: createNode

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
public ANode createNode(ANode parent, Object jrObject, int newIndex) {
	if (jrObject instanceof JRDesignChart)
		return new MChart(parent, (JRDesignChart) jrObject, newIndex);
	if (jrObject instanceof JRDesignChartAxis) {
		MChartAxes mChartAxes = new MChartAxes(parent, (JRChartAxis) jrObject, newIndex);
		return mChartAxes;
	}
	if (jrObject instanceof JRDesignChartDataset)
		return ChartDatasetFactory.getChartDataset(parent, (JRChartDataset) jrObject, newIndex);
	if (jrObject instanceof JRDesignCategorySeries)
		return new MCategorySeries(parent, (JRDesignCategorySeries) jrObject, newIndex);
	if (jrObject instanceof JRDesignGanttSeries)
		return new MGanttSeries(parent, (JRDesignGanttSeries) jrObject, newIndex);
	if (jrObject instanceof JRDesignPieSeries)
		return new MPieSeries(parent, (JRDesignPieSeries) jrObject, newIndex);
	if (jrObject instanceof JRDesignTimePeriodSeries)
		return new MTimePeriodSeries(parent, (JRDesignTimePeriodSeries) jrObject, newIndex);
	if (jrObject instanceof JRDesignTimeSeries)
		return new MTimeSeries(parent, (JRDesignTimeSeries) jrObject, newIndex);
	if (jrObject instanceof JRDesignXySeries)
		return new MXYSeries(parent, (JRDesignXySeries) jrObject, newIndex);
	if (jrObject instanceof JRDesignXyzSeries)
		return new MXYZSeries(parent, (JRDesignXyzSeries) jrObject, newIndex);
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:ChartComponentFactory.java

示例5: JRDesignValueDataset

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
 * Construct a new dataset that is a copy of an existing one.
 *
 * @param dataset the dataset to copy
 */
public JRDesignValueDataset(JRChartDataset dataset)
{
	super(dataset);
	
	if (dataset == null)
	{
		// value datasets hold a single value hence a reset type other
		// than None doesn't make sense
		// setting None as default reset type so that it doesn't need to be
		// explicitly set in order for the dataset to work as expected
		this.resetTypeValue = ResetTypeEnum.NONE;
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:JRDesignValueDataset.java

示例6: JRFillChartDataset

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
 *
 */
protected JRFillChartDataset(
	JRChartDataset dataset, 
	JRFillObjectFactory factory
	)
{
	super(dataset, factory);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:JRFillChartDataset.java

示例7: createXYBarChart

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
	 *
	 */
	protected JFreeChart createXYBarChart() throws JRException
	{
		IntervalXYDataset tmpDataset = (IntervalXYDataset)getDataset();

		boolean isDate = true;
		if ( getChart().getDataset().getDatasetType() == JRChartDataset.XY_DATASET ){
			isDate = false;
		}

		ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
		JFreeChart jfreeChart =
			ChartFactory.createXYBarChart(
				evaluateTextExpression(getChart().getTitleExpression()),
				evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
				isDate,
				evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
				tmpDataset,
				getPlot().getOrientationValue().getOrientation(),
				isShowLegend(),
				true,
				false
				);

		configureChart(jfreeChart, getPlot());

		XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
		//plot.setNoDataMessage("No data to display");
//		((XYPlot)plot.getDomainAxis()).setTickMarksVisible(
//			((JRBarPlot)getPlot()).isShowTickMarks()
//			);
//		((CategoryAxis)plot.getDomainAxis()).setTickLabelsVisible(
//				((JRBarPlot)getPlot()).isShowTickLabels()
//				);
//		((NumberAxis)plot.getRangeAxis()).setTickMarksVisible(
//				((JRBarPlot)getPlot()).isShowTickMarks()
//				);
//		((NumberAxis)plot.getRangeAxis()).setTickLabelsVisible(
//				((JRBarPlot)getPlot()).isShowTickLabels()
//				);


		XYBarRenderer itemRenderer = (XYBarRenderer)xyPlot.getRenderer();
		itemRenderer.setBaseItemLabelGenerator((XYItemLabelGenerator)getLabelGenerator());
		itemRenderer.setShadowVisible(false);

		JRBarPlot barPlot = (JRBarPlot)getPlot();
		boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
		
		itemRenderer.setBaseItemLabelsVisible( isShowLabels );

		// Handle the axis formating for the category axis
		configureAxis(xyPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
				barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
				barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
				barPlot.getOwnCategoryAxisLineColor(), false,
				(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()),
				(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression()));

		// Handle the axis formating for the value axis
		configureAxis(xyPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
				barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
				barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
				barPlot.getOwnValueAxisLineColor(), true,
				(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
				(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

		return jfreeChart;
	}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:72,代码来源:GenericChartTheme.java

示例8: createXYBarChart

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
	 *
	 */
	protected JFreeChart createXYBarChart() throws JRException
	{
		IntervalXYDataset tmpDataset = (IntervalXYDataset)getDataset();

		boolean isDate = true;
		if ( getChart().getDataset().getDatasetType() == JRChartDataset.XY_DATASET ){
			isDate = false;
		}

		ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
		JFreeChart jfreeChart =
			ChartFactory.createXYBarChart(
				evaluateTextExpression(getChart().getTitleExpression()),
				evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
				isDate,
				evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
				tmpDataset,
				getPlot().getOrientationValue().getOrientation(),
				isShowLegend(),
				true,
				false
				);

		configureChart(jfreeChart, getPlot());

		XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
		//plot.setNoDataMessage("No data to display");
//		((XYPlot)plot.getDomainAxis()).setTickMarksVisible(
//			((JRBarPlot)getPlot()).isShowTickMarks()
//			);
//		((CategoryAxis)plot.getDomainAxis()).setTickLabelsVisible(
//				((JRBarPlot)getPlot()).isShowTickLabels()
//				);
//		((NumberAxis)plot.getRangeAxis()).setTickMarksVisible(
//				((JRBarPlot)getPlot()).isShowTickMarks()
//				);
//		((NumberAxis)plot.getRangeAxis()).setTickLabelsVisible(
//				((JRBarPlot)getPlot()).isShowTickLabels()
//				);


		XYBarRenderer itemRenderer = (XYBarRenderer)xyPlot.getRenderer();
		itemRenderer.setBaseItemLabelGenerator((XYItemLabelGenerator)getLabelGenerator());
		itemRenderer.setShadowVisible(false);

		JRBarPlot barPlot = (JRBarPlot)getPlot();
		boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
		
		itemRenderer.setBaseItemLabelsVisible( isShowLabels );

		// Handle the axis formating for the category axis
		configureAxis(xyPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
				barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
				barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
				barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(), DateTickUnitType.DAY,
				(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()), 
				(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
				);


		// Handle the axis formating for the value axis
		configureAxis(xyPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
				barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
				barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
				barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(), DateTickUnitType.DAY,
				(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()), 
				(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
				);

		return jfreeChart;
	}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:75,代码来源:SimpleChartTheme.java

示例9: JRBasePieDataset

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
 *
 */
public JRBasePieDataset(JRChartDataset dataset)
{
	super(dataset);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRBasePieDataset.java

示例10: getDatasetType

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
@Override
public byte getDatasetType() {
	return JRChartDataset.PIE_DATASET;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:5,代码来源:JRBasePieDataset.java

示例11: JRBaseXyzDataset

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
public JRBaseXyzDataset( JRChartDataset dataset){
	super( dataset);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:4,代码来源:JRBaseXyzDataset.java

示例12: getDatasetType

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
@Override
public byte getDatasetType() {
	return JRChartDataset.XYZ_DATASET;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:5,代码来源:JRBaseXyzDataset.java

示例13: JRBaseXyDataset

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
/**
 *
 */
public JRBaseXyDataset(JRChartDataset dataset)
{
	super(dataset);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRBaseXyDataset.java

示例14: getDatasetType

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
@Override
public byte getDatasetType() {
	return JRChartDataset.XY_DATASET;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:5,代码来源:JRBaseXyDataset.java

示例15: getDatasetType

import net.sf.jasperreports.engine.JRChartDataset; //导入依赖的package包/类
@Override
public byte getDatasetType() {
	return JRChartDataset.TIMESERIES_DATASET;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:5,代码来源:JRBaseTimeSeriesDataset.java


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