ExtendedItemHandle extendedItemHandle = elementFactory.newExtendedItem(null, "Chart");
extendedItemHandle.setHeight( "288pt" );
extendedItemHandle.setWidth( "252pt" );
extendedItemHandle.setProperty( ExtendedItemHandle.DATA_SET_PROP, "Data Set" );
// Add chart instance to IReportItem
extendedItemHandle.getReportItem( ).setProperty( "chart.instance", ChartUtil.createPieChart( ) );
designHandle.getBody().add(extendedItemHandle);
调用方法创建图表
public static Chart createPieChart() {
ChartWithoutAxes cwoaPie = ChartWithoutAxesImpl.create();
cwoaPie.setDimension(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL);
cwoaPie.setType("Pie Chart"); //$NON-NLS-1$
cwoaPie.setSubType("Standard Pie Chart"); //$NON-NLS-1$
// Plot
cwoaPie.setSeriesThickness(10);
// Legend
Legend lg = cwoaPie.getLegend();
lg.getOutline().setVisible(true);
// Title
cwoaPie.getTitle().getLabel().getCaption().setValue("Pie Chart");//$NON-NLS-1$
// Data Set
TextDataSet categoryValues = TextDataSetImpl
.create(new String[] {
"New York", "Boston", "Chicago", "San Francisco", "Dallas", "cs" });//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
NumberDataSet seriesOneValues = NumberDataSetImpl.create(new double[] {
54.65, 21, 75.95, 91.28, 37.43, 2.2 });
SampleData sdata = DataFactory.eINSTANCE.createSampleData();
BaseSampleData sdBase = DataFactory.eINSTANCE.createBaseSampleData();
sdBase.setDataSetRepresentation("");//$NON-NLS-1$
sdata.getBaseSampleData().add(sdBase);
OrthogonalSampleData sdOrthogonal = DataFactory.eINSTANCE
.createOrthogonalSampleData();
sdOrthogonal.setDataSetRepresentation("");//$NON-NLS-1$
sdOrthogonal.setSeriesDefinitionIndex(0);
sdata.getOrthogonalSampleData().add(sdOrthogonal);
cwoaPie.setSampleData(sdata);
// Base Series
Series seCategory = SeriesImpl.create();
seCategory.setDataSet(categoryValues);
SeriesDefinition sd = SeriesDefinitionImpl.create();
cwoaPie.getSeriesDefinitions().add(sd);
// sd.getSeriesPalette( ).shift( 0 );
final Fill[] fiaBase = {
ColorDefinitionImpl.create(45, 150, 225),
ColorDefinitionImpl.ORANGE(),
ColorDefinitionImpl.CREAM(),
ColorDefinitionImpl.RED(),
ColorDefinitionImpl.GREEN(),
GradientImpl.create(ColorDefinitionImpl.create(225, 225, 255),
ColorDefinitionImpl.create(255, 255, 225), -35, false),
ColorDefinitionImpl.CYAN().darker(), };
sd.getSeriesPalette().getEntries().clear();
for (int i = 0; i < fiaBase.length; i++) {
sd.getSeriesPalette().getEntries().add(fiaBase[i]);
}
sd.getSeriesPalette().getEntries();
sd.getSeries().add(seCategory);
// Orthogonal Series
PieSeries sePie = (PieSeries) PieSeriesImpl.create();
sePie.setDataSet(seriesOneValues);
sePie.setSeriesIdentifier("Cities");//$NON-NLS-1$
sePie.setExplosion(5);
SeriesDefinition sdCity = SeriesDefinitionImpl.create();
sd.getSeriesDefinitions().add(sdCity);
sdCity.getSeries().add(sePie);
return cwoaPie;
}
分享到:
相关推荐
Delphi7.0源码生成一个柱状图表chart,使用了ntdll.dll,这个直方图表效果如图所示。使用了第三方控件实现的图表制作生成软件,功能比较强大。以下是图表测试源代码: Chart := TChart.Create(nil); try Chart...
JClass ServerReport是一个100%纯Java 服务器端组件库,能在您的J2EE基于服务器的Java应用程序中动态的生成定制的Adobe Acrobat PDF 文档,为您的用户提供专业的,高质量,可随处打印的定制报表。JClass Server...
C# 动态添加数据到折线图 chart 动态折线图。 C#窗口程序chart控件实现动态将数据添加到折线图的功能,勾选框可指示数据是否显示 C# chart 动态折线图
3.2.5 将日期转换为文本以添加装饰性图表元素 78 3.3 使用图表进行有效交流 81 3.3.1 使用有意义的长标题解释图表的含义 82 3.3.2 突出一列 85 3.3.3 用箭头取代柱形 86 3.3.4 添加另一个序列来突出图表...
3.2.5 将日期转换为文本以添加装饰性图表元素 78 3.3 使用图表进行有效交流 81 3.3.1 使用有意义的长标题解释图表的含义 82 3.3.2 突出一列 85 3.3.3 用箭头取代柱形 86 3.3.4 添加另一个序列来突出图表...
3.2.5 将日期转换为文本以添加装饰性图表元素 78 3.3 使用图表进行有效交流 81 3.3.1 使用有意义的长标题解释图表的含义 82 3.3.2 突出一列 85 3.3.3 用箭头取代柱形 86 3.3.4 添加另一个序列来突出图表...
3.2.5 将日期转换为文本以添加装饰性图表元素 78 3.3 使用图表进行有效交流 81 3.3.1 使用有意义的长标题解释图表的含义 82 3.3.2 突出一列 85 3.3.3 用箭头取代柱形 86 3.3.4 添加另一个序列来突出图表...
3.2.5 将日期转换为文本以添加装饰性图表元素 78 3.3 使用图表进行有效交流 81 3.3.1 使用有意义的长标题解释图表的含义 82 3.3.2 突出一列 85 3.3.3 用箭头取代柱形 86 3.3.4 添加另一个序列来突出图表...
3.2.5 将日期转换为文本以添加装饰性图表元素 78 3.3 使用图表进行有效交流 81 3.3.1 使用有意义的长标题解释图表的含义 82 3.3.2 突出一列 85 3.3.3 用箭头取代柱形 86 3.3.4 添加另一个序列来突出图表...
chart({'type':'column'})方 法指定图表类型为柱形,使用write_row、write_column方法分别以行、 列方式写入数据,使用add_format()方法定制表头、表体的显示风格,使用add_series()方法将数据添加到图表,...
VB向图表中添加行标签和列标签,要学会使用图表的话,这是一个最基础的功能了,添加新的行列,就等于在图表中添加一个柱状单元,每增加一项需要显示的数据列,就需要添加一个图表单元,因此,本源码例子具有相当好的...
FusionCharts free版 是flash图表,free版已知bug,纵坐标不能为中文。数据专递只能用xml格式(可以自己拼串解决支持json) Amcharts (非开源,商业收费)是Flash图表,支持HTML5,可以从简单的CSV或XML文件提取...
向工作表中添加图表时,Visual Studio Tools for Office将创建一个 Chart对象,可以直接对此对象进行编程,而不必遍历 Microsoft Office Excel对象模型。 4、开放的系统平台架构,完善的二次开发支持,无限扩展功能 ...
添加完善的表格,分组,图表,图形表示,Excel 报表,增强的编辑和更多的用户界面功能到你的 .NET Windows forms 和 ASP.NET 程序。 Essential Studio 包括以下组件: - Essential Tools - 强大的用户界面控件,...
添加完善的表格,分组,图表,图形表示,Excel 报表,增强的编辑和更多的用户界面功能到你的 .NET Windows forms 和 ASP.NET 程序。 Essential Studio 包括以下组件: - Essential Tools - 强大的用户界面控件,...
添加完善的表格,分组,图表,图形表示,Excel 报表,增强的编辑和更多的用户界面功能到你的 .NET Windows forms 和 ASP.NET 程序。 Essential Studio 包括以下组件: - Essential Tools - 强大的用户界面控件,...
添加完善的表格,分组,图表,图形表示,Excel 报表,增强的编辑和更多的用户界面功能到你的 .NET Windows forms 和 ASP.NET 程序。 Essential Studio 包括以下组件: - Essential Tools - 强大的用户界面控件,...
添加完善的表格,分组,图表,图形表示,Excel 报表,增强的编辑和更多的用户界面功能到你的 .NET Windows forms 和 ASP.NET 程序。 Essential Studio 包括以下组件: - Essential Tools - 强大的用户界面控件,...