本文整理汇总了Java中net.sf.jasperreports.engine.JRChart类的典型用法代码示例。如果您正苦于以下问题:Java JRChart类的具体用法?Java JRChart怎么用?Java JRChart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRChart类属于net.sf.jasperreports.engine包,在下文中一共展示了JRChart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: verifyChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的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
示例2: writeXyBarChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的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: writePieChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
/**
*
*/
public void writePieChart( JRChart chart, String chartName)
{
if(chart != null)
{
write( "JRDesignChart " + chartName + " = new JRDesignChart(jasperDesign, JRChart.CHART_TYPE_PIE);\n");
writeChart( chart, chartName);
writePieDataset( (JRPieDataset)chart.getDataset(), chartName, "PieDataset");
// write plot
JRPiePlot plot = (JRPiePlot) chart.getPlot();
if(plot != null)
{
String plotName = chartName + "PiePlot";
write( "JRDesignPiePlot " + plotName + " = (JRDesignPiePlot)" + chartName + ".getPlot();\n");
write( plotName + ".setShowLabels({0});\n", getBooleanText(plot.getShowLabels()));
write( plotName + ".setCircular({0});\n", getBooleanText(plot.getCircular()));
write( plotName + ".setLabelFormat(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(plot.getLabelFormat()));
write( plotName + ".setLegendLabelFormat(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(plot.getLegendLabelFormat()));
writePlot( plot, plotName);
writeItemLabel( plot.getItemLabel(),plotName, "ItemLabel");
flush();
}
flush();
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:JRApiWriter.java
示例4: JRBaseMeterPlot
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
/**
* Constructs a copy of an existing meter.
*
* @param plot the plot to copy
*/
public JRBaseMeterPlot(JRChartPlot plot, JRChart chart)
{
super(plot, chart);
JRMeterPlot meterPlot = plot instanceof JRMeterPlot ? (JRMeterPlot)plot : null;
if (meterPlot == null)
{
valueDisplay = new JRBaseValueDisplay(null, chart);
}
else
{
valueDisplay = new JRBaseValueDisplay(meterPlot.getValueDisplay(), chart);
tickLabelFont = meterPlot.getTickLabelFont();
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRBaseMeterPlot.java
示例5: JRBaseBar3DPlot
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
protected JRBaseBar3DPlot(JRChartPlot plot, JRChart chart, ChartCopyObjectFactory copyObjectFactory)
{
super(plot, chart);
JRBar3DPlot barPlot = plot instanceof JRBar3DPlot ? (JRBar3DPlot)plot : null;
if (barPlot == null)
{
itemLabel = copyObjectFactory.copyItemLabel(null, chart);
}
else
{
categoryAxisLabelFont = barPlot.getCategoryAxisLabelFont();
categoryAxisTickLabelFont = getCategoryAxisTickLabelFont();
valueAxisLabelFont = barPlot.getValueAxisLabelFont();
valueAxisTickLabelFont = barPlot.getValueAxisTickLabelFont();
itemLabel = copyObjectFactory.copyItemLabel(barPlot.getItemLabel(), chart);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:JRBaseBar3DPlot.java
示例6: writeXyBarChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的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
示例7: createObject
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public Object createObject(Attributes attrs)
{
JRChart chart = (JRChart) digester.peek();
JRDesignPieDataset dataset = (JRDesignPieDataset)chart.getDataset();
String minPercentage = attrs.getValue(ATTRIBUTE_minPercentage);
if(minPercentage != null && minPercentage.length() > 0)
{
dataset.setMinPercentage(Float.valueOf(minPercentage));
}
String maxCount = attrs.getValue(ATTRIBUTE_maxCount);
if(maxCount != null && maxCount.length() > 0)
{
dataset.setMaxCount(Integer.valueOf(maxCount));
}
return dataset;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRPieDatasetFactory.java
示例8: visitChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void visitChart(JRChart chart)
{
JRBaseChart baseChart = null;
if (chart != null)
{
baseChart = (JRBaseChart)get(chart);
if (baseChart == null)
{
baseChart = new JRBaseChart(chart, this);
}
}
setVisitResult(baseChart);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRBaseObjectFactory.java
示例9: writePieChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
/**
*
*/
public void writePieChart(JRChart chart) throws IOException
{
writer.startElement(JRXmlConstants.ELEMENT_pieChart, getNamespace());
writeChart(chart);
writePieDataset((JRPieDataset) chart.getDataset());
// write plot
JRPiePlot plot = (JRPiePlot) chart.getPlot();
writer.startElement(JRXmlConstants.ELEMENT_piePlot);
if(isNewerVersionOrEqual(JRConstants.VERSION_3_7_5))
{
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isShowLabels, plot.getShowLabels());
}
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isCircular, plot.getCircular());
if(isNewerVersionOrEqual(JRConstants.VERSION_3_1_0))
{
writer.addAttribute(JRXmlConstants.ATTRIBUTE_labelFormat, plot.getLabelFormat());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_legendLabelFormat, plot.getLegendLabelFormat());
}
writePlot(chart.getPlot());
writeItemLabel(plot.getItemLabel());
writer.closeElement();
writer.closeElement();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:JRXmlWriter.java
示例10: visitChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void visitChart(JRChart chart)
{
JRFillChart fillChart = null;
if (chart != null)
{
fillChart = (JRFillChart)get(chart);
if (fillChart == null)
{
fillChart = new JRFillChart(filler, chart, this);
}
}
setVisitResult(fillChart);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRFillObjectFactory.java
示例11: convert
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public JRPrintElement convert(ReportConverter reportConverter, JRElement element)
{
JRBasePrintImage printImage = new JRBasePrintImage(reportConverter.getDefaultStyleProvider());
JRChart chart = (JRChart)element;
copyElement(reportConverter, chart, printImage);
printImage.copyBox(chart.getLineBox());
printImage.setAnchorName(JRExpressionUtil.getExpressionText(chart.getAnchorNameExpression()));
printImage.setBookmarkLevel(chart.getBookmarkLevel());
printImage.setLinkType(chart.getLinkType());
printImage.setOnErrorType(OnErrorTypeEnum.ICON);
printImage.setRenderer(getRenderer(reportConverter, chart));
printImage.setScaleImage(ScaleImageEnum.CLIP);
return printImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:ChartConverter.java
示例12: createObject
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public Object createObject( Attributes attrs ){
JRChart chart = (JRChart)digester.peek();
JRDesignScatterPlot plot = (JRDesignScatterPlot)chart.getPlot();
String isShowShapes = attrs.getValue( ATTRIBUTE_isShowShapes );
if( isShowShapes != null && isShowShapes.length() > 0 ){
plot.setShowShapes(Boolean.valueOf(isShowShapes) );
}
String isShowLines = attrs.getValue( ATTRIBUTE_isShowLines );
if( isShowLines != null && isShowLines.length() > 0 ){
plot.setShowLines(Boolean.valueOf(isShowLines) );
}
return plot;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:JRScatterPlotFactory.java
示例13: customize
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void customize(JFreeChart jfc, JRChart jrc)
{
Plot plot = jfc.getPlot();
if (plot instanceof XYPlot)
{
((XYPlot)plot).setRenderer( new XYSplineRenderer());
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:SplineCustomizer.java
示例14: customize
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void customize(JFreeChart jfc, JRChart jrc)
{
if (jfc.getPlot() instanceof XYPlot)
{
Marker marker = createMarker();
if (marker != null)
{
addMarker(jfc.getPlot(), marker);
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:DomainIntervalMarkerCustomizer.java
示例15: customize
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void customize(JFreeChart jfc, JRChart jrc)
{
if (jfc.getPlot() instanceof XYPlot)
{
Marker marker = createMarker();
if (marker != null)
{
addMarker(jfc.getXYPlot(), marker);
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:RangeValueMarkerCustomizer.java
示例16: getForecolor
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
/**
*
*/
public Color getForecolor(JRChartPlot plot)
{
JRChart chart = plot.getChart();
if (chart != null)
{
return getForecolor(chart);
}
return Color.black;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:StyleResolver.java
示例17: customize
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void customize(JFreeChart jfc, JRChart jrc)
{
Plot plot = jfc.getPlot();
ItemsCounter itemsCounter = new LegendItemsCounter(plot);
SeriesNameProvider seriesNameProvider = null;
Object renderer = null;
if (plot instanceof XYPlot)
{
XYPlot xyPlot = jfc.getXYPlot();
renderer = xyPlot.getRenderer();
seriesNameProvider = new XYPlotSeriesNameProvider(xyPlot);
}
else if (plot instanceof CategoryPlot)
{
CategoryPlot categoryPlot = jfc.getCategoryPlot();
renderer = categoryPlot.getRenderer();
seriesNameProvider = new CategorySeriesNameProvider(categoryPlot);
}
Integer legendItemIndex = CustomizerUtil.resolveIndex(this, itemsCounter, seriesNameProvider);
if (
legendItemIndex != null
&& renderer instanceof AbstractRenderer
)
{
ShapeSetter shapeSetter = new AbstractRendererLegendShapeSetter((AbstractRenderer)renderer);
if (legendItemIndex == -1)
{
updateItems(itemsCounter, shapeSetter);
}
else
{
updateItem(itemsCounter, shapeSetter, legendItemIndex);
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:40,代码来源:LegendShapeCustomizer.java
示例18: visitChart
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
@Override
public void visitChart(JRChart chart)
{
JRPrintElement printImage = ChartConverter.getInstance().convert(reportConverter, chart);
addElement(parentFrame, printImage);
addContour(reportConverter, parentFrame, printImage);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:ConvertVisitor.java
示例19: JRBaseThermometerPlot
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
/**
* Constructs a new thermometer plot that is a copy of an existing one.
*
* @param plot the plot to copy
* @param chart the parent chart
*/
public JRBaseThermometerPlot(JRChartPlot plot, JRChart chart)
{
super(plot, chart);
JRThermometerPlot thermoPlot = plot instanceof JRThermometerPlot ? (JRThermometerPlot)plot : null;
if (thermoPlot == null)
{
valueDisplay = new JRBaseValueDisplay(null, chart);
}
else
{
valueDisplay = new JRBaseValueDisplay(thermoPlot.getValueDisplay(), chart);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRBaseThermometerPlot.java
示例20: JRBaseBubblePlot
import net.sf.jasperreports.engine.JRChart; //导入依赖的package包/类
/**
*
*/
public JRBaseBubblePlot(JRChartPlot plot, JRChart chart)
{
super(plot, chart);
JRBubblePlot bubblePlot = plot instanceof JRBubblePlot ? (JRBubblePlot)plot : null;
if (bubblePlot != null)
{
xAxisLabelFont = bubblePlot.getXAxisLabelFont();
xAxisTickLabelFont = bubblePlot.getXAxisTickLabelFont();
yAxisLabelFont = bubblePlot.getYAxisLabelFont();
yAxisTickLabelFont = bubblePlot.getYAxisTickLabelFont();
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRBaseBubblePlot.java
注:本文中的net.sf.jasperreports.engine.JRChart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论