ChartDirector示例手册.docx

上传人:b****6 文档编号:8551066 上传时间:2023-01-31 格式:DOCX 页数:94 大小:567.42KB
下载 相关 举报
ChartDirector示例手册.docx_第1页
第1页 / 共94页
ChartDirector示例手册.docx_第2页
第2页 / 共94页
ChartDirector示例手册.docx_第3页
第3页 / 共94页
ChartDirector示例手册.docx_第4页
第4页 / 共94页
ChartDirector示例手册.docx_第5页
第5页 / 共94页
点击查看更多>>
下载资源
资源描述

ChartDirector示例手册.docx

《ChartDirector示例手册.docx》由会员分享,可在线阅读,更多相关《ChartDirector示例手册.docx(94页珍藏版)》请在冰豆网上搜索。

ChartDirector示例手册.docx

ChartDirector示例手册

ChartDirector示例手册

简介3

特征描述3

示例5

一、饼图5

1、SimplePieChart5

2、3DPieChart7

3、PieChartwithLegend8

4、SideLabelLayout10

5、PiewithSmallSectors12

6、CircularLabelLayout14

7、IconPieChart16

8、TextStylesandColors19

9、ColoringandWallpaper21

二、柱状图25

1、SimpleBarChart25

2、3DBarChart26

3、PolygonBarShapes28

4、StackedBarChart30

5、Multi-ShapeBarChart32

6、OverlappingBarChart34

7、DepthBarChart36

8、PositiveNegativeBars38

三、折线图40

1、SimpleLineChart40

2、3DLineChart42

3、Multi-LineChart44

4、LineComparison46

5、LinewithErrorSymbols49

6、Multi-SymbolLineChart52

四、仪表盘55

1、Semi-CircleMeter55

2、RoundMeter57

3、WideAngularMeters59

4、SquareAngularMeters61

5、Multi-PointerAngularMeter64

6、Multi-PointerHorizontalMeter65

7、LinearZoneMeter67

五、雷达图69

1、SimpleRadarChart69

2、MultiRadarChart71

3、PolarLineChart73

4、PolarAreaChart76

5、PolarBubbleChart78

6、CircularZones81

7、SectorZones84

 

简介

ChartDirector控件使用方便,快捷,灵活,功能强大,交互性强。

在web服务器以及嵌入式应用程序开发中,它是一种非常理想的工具,拥有丰富的图表图形组件库.

特征描述

∙高效快捷

采用多线程结构,特别应用于具有高性能要求的服务器端应用程序开发。

∙灵活性

拥有基于API(应用编程接口)的对象,允许用户控制和定制图表细节,从而设计出用户满意的图表。

∙丰富而全面的图表样式

圆形图表(饼状图),圆环图,柱形图(条形图),直线图,曲线图,梯级线图,趋势线图,曲线拟合图,线间色图,区域图,散布图(散形图),泡沫图,floatingbox,box-whisker,瀑布图,金融类图表,甘特图表,向量图,雷达图,极线图,rose,XY轴交换(旋转图表)和3D效果。

∙金融类图表库(附有源代码)

拥有成熟的金融类图表(具有46种技术指标)库。

∙仪表和量表

含有可以测量任意角度的测角仪表和可以进行横向和纵向测量的线性仪表。

∙层结构

具有同步处理能力的图表层允许不同的图表样式重叠,从而获得任意的组合图表,并且达到特殊的效果。

例如,box-whisker可以用来添加错误标记到任意的XY图表样式上;还有散布图层可以用来加亮具有个性化标记的数据点。

∙CDML(图表制作向导标记语言)

图表制作向导标记语言这项创新性技术可以给内嵌有图标和图片的文档提供丰富的样式。

该语言是基于所有的CharDirector文档定位符,其中包括有图表标题,图例关键字,轴标签,以及数据标签等等。

∙高级的着色系统

除了ARGB颜色(具有阿尔法透明性的真彩色)之外,在ChartDirector中所有对象还可以着上“奇妙的颜色”——这种颜色依赖于定位。

该系统还包括:

颜色式样,颜色梯度,金属颜色,依赖于数据取值的颜色(比如,指示阀)

∙图像映射自动生成

生成的图像映射可以支持工具使用提示以及鼠标与图形控件的交互。

具有对图像进行细化处理的能力。

工具提示可以用户定做,包括一些具有个性化的文字和数据。

图像映射是可扩展的,可以包含用户自定义的区域,比如公司标志,标签,以及按钮。

∙浏览器的兼容性

生成的图表是PNG,JPEG,BMP,WBMP,以及GIF格式的,这些图表格式对所有浏览器都是可见的,其中包括移动设备和手持设备。

图表可以作为图片嵌入到E-Mail(电子邮件),WORD文档,PDF格式文档等等,并且客户端不需要使用任何Java或者ActiveX控件。

∙快捷的图表生成和传输

图表可以快捷地生成并传输到浏览器端,并且作为一个标准的Http图像数据进行存储,而不需要占用临时的图像文件。

∙节约带宽

采用优化的颜色缩减算法,来制作基于调色板的图表,其效果等同于真彩色图表,并且文件所占空间变得更小。

特别是对于因特网应用开发是一款非常理想的工具。

∙国际化标准

支持统一字符编码,可自行设置数字,日期/时间格式。

∙支持语言

支持多种语言,例如.NET, Java, ASP, COM,VB, PHP, Perl, Python,Ruby, ColdFusion, C++等;

示例

一、饼图

1、SimplePieChart

示例代码:

<%@pageimport="ChartDirector.*"%>

<%

//Thedataforthepiechart

double[]data={25,18,15,12,8,30,35};

//Thelabelsforthepiechart

String[]labels={"Labor","Licenses","Taxes","Legal","Insurance","Facilities",

"Production"};

//CreateaPieChartobjectofsize360x300pixels

PieChartc=newPieChart(360,300);

//Setthecenterofthepieat(180,140)andtheradiusto100pixels

c.setPieSize(180,140,100);

//Setthepiedataandthepielabels

c.setData(data,labels);

//outputthechart

Stringchart1URL=c.makeSession(request,"chart1");

//Includetooltipforthechart

StringimageMap1=c.getHTMLImageMap("","",

"title='{label}:

US${value}K({percent}%)'");

%>

18pt;font-family:

verdana;font-weight:

bold">

SimplePieChart

file=<%=request.getServletPath()%>">

ViewChartSourceCode


"+chart1URL)%>'

usemap="#map1"border="0">

<%=imageMap1%>

2、3DPieChart

示例代码:

<%@pageimport="ChartDirector.*"%>

<%

//Thedataforthepiechart

double[]data={25,18,15,12,8,30,35};

//Thelabelsforthepiechart

String[]labels={"Labor","Licenses","Taxes","Legal","Insurance","Facilities",

"Production"};

//CreateaPieChartobjectofsize360x300pixels

PieChartc=newPieChart(360,300);

//Setthecenterofthepieat(180,140)andtheradiusto100pixels

c.setPieSize(180,140,100);

//Addatitletothepiechart

c.addTitle("ProjectCostBreakdown");

//Drawthepiein3D

c.set3D();

//Setthepiedataandthepielabels

c.setData(data,labels);

//Explodethe1stsector(index=0)

c.setExplode(0);

//outputthechart

Stringchart1URL=c.makeSession(request,"chart1");

//Includetooltipforthechart

StringimageMap1=c.getHTMLImageMap("","",

"title='{label}:

US${value}K({percent}%)'");

%>

18pt;font-family:

verdana;font-weight:

bold">

3DPieChart

file=<%=request.getServletPath()%>">

ViewChartSourceCode


"+chart1URL)%>'

usemap="#map1"border="0">

<%=imageMap1%>

3、PieChartwithLegend

示例代码:

<%@pageimport="ChartDirector.*"%>

<%

//Thedataforthepiechart

double[]data={25,18,15,12,8,30,35};

//Thelabelsforthepiechart

String[]labels={"Labor","Licenses","Taxes","Legal","Insurance","Facilities",

"Production"};

//CreateaPieChartobjectofsize450x240pixels

PieChartc=newPieChart(450,240);

//Setthecenterofthepieat(150,100)andtheradiusto80pixels

c.setPieSize(150,100,80);

//AddatitleatthebottomofthechartusingArialBoldItalicfont

c.addTitle2(Chart.Bottom,"ProjectCostBreakdown","ArialBoldItalic");

//Drawthepiein3D

c.set3D();

//addalegendboxwherethetopleftcornerisat(330,40)

c.addLegend(330,40);

//modifythelabelformatforthesectorsto$nnnK(pp.pp%)

c.setLabelFormat("{label}${value}K\n({percent}%)");

//Setthepiedataandthepielabels

c.setData(data,labels);

//Explodethe1stsector(index=0)

c.setExplode(0);

//outputthechart

Stringchart1URL=c.makeSession(request,"chart1");

//Includetooltipforthechart

StringimageMap1=c.getHTMLImageMap("","",

"title='{label}:

US${value}K({percent}%)'");

%>

18pt;font-family:

verdana;font-weight:

bold">

PieChartwithLegend

file=<%=request.getServletPath()%>">

ViewChartSourceCode


"+chart1URL)%>'

usemap="#map1"border="0">

<%=imageMap1%>

4、SideLabelLayout

示例代码:

<%@pageimport="ChartDirector.*"%>

<%

//Thedataforthepiechart

double[]data={25,18,15,12,8,30,35};

//Thelabelsforthepiechart

String[]labels={"Labor","Licenses","Taxes","Legal","Insurance","Facilities",

"Production"};

//CreateaPieChartobjectofsize500x230pixels

PieChartc=newPieChart(500,230);

//Setthecenterofthepieat(250,120)andtheradiusto100pixels

c.setPieSize(250,120,100);

//Addatitleboxusing15pointsTimesBoldItalicasfont

c.addTitle("ProjectCostBreakdown","TimesNewRomanBoldItalic",15);

//Drawthepiein3D

c.set3D();

//Usethesidelabellayoutmethod

c.setLabelLayout(Chart.SideLayout);

//Setthepiedataandthepielabels

c.setData(data,labels);

//outputthechart

Stringchart1URL=c.makeSession(request,"chart1");

//Includetooltipforthechart

StringimageMap1=c.getHTMLImageMap("","",

"title='{label}:

US${value}K({percent}%)'");

%>

18pt;font-family:

verdana;font-weight:

bold">

SideLabelLayout

file=<%=request.getServletPath()%>">

ViewChartSourceCode


"+chart1URL)%>'

usemap="#map1"border="0">

<%=imageMap1%>

5、PiewithSmallSectors

示例代码:

<%@pageimport="ChartDirector.*"%>

<%

//Thedataforthepiechart

double[]data={35,30,25,7,6,5,4,3,2,1};

//Thelabelsforthepiechart

String[]labels={"Labor","Production","Facilities","Taxes","Misc","Legal",

"Insurance","Licenses","Transport","Interest"};

//CreateaPieChartobjectofsize560x270pixels,withagoldenbackgroundanda

//1pixel3Dborder

PieChartc=newPieChart(560,270,Chart.goldColor(),-1,1);

//Addatitleboxusing15ptsTimesBoldItalicfontandmetallicpinkbackground

//color

c.addTitle("ProjectCostBreakdown","TimesNewRomanBoldItalic",15

).setBackground(Chart.metalColor(0xff9999));

//Setthecenterofthepieat(280,135)andtheradiusto110pixels

c.setPieSize(280,135,110);

//Drawthepiein3Dwith20pixels3Ddepth

c.set3D(20);

//Usethesidelabellayoutmethod

c.setLabelLayout(Chart.SideLayout);

//Setthelabelboxbackgroundcolorthesameasthesectorcolor,withglass

//effect,andwith5pixelsroundedcorners

TextBoxt=c.setLabelStyle();

t.setBackground(Chart.SameAsMainColor,Chart.Transparent,Chart.glassEffect());

t.setRoundedCorners(5);

//Setthebordercolorofthesectorthesamecolorasthefillcolor.Settheline

//colorofthejoinlinetoblack(0x0)

c.setLineColor(Chart.SameAsMainColor,0x000000);

//Setthestartangleto135degreesmayimprovelayoutwhentherearemanysmall

//sectorsattheendofthedataarray(thatis,datasortedindescendingorder).

//Itisbecausethismakesthesmallsectorspositionnearthehorizontalaxis,

//wherethetextlabelhastheleasttendencytooverlap.Fordatasortedin

//ascendingorder,astartangleof45degreescanbeusedinstead.

c.setStartAngle(135);

//Setthepiedataandthepielabels

c.setData(data,label

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 外语学习 > 韩语学习

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1