提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|其它|编辑:郝浩|2012-11-15 10:49:12.000|阅读 819 次
概述:ChartDirector是一种非常强大的图表控件,拥有丰富的图表图形库,本文将通过代码介绍如何在ChartDirector创建出不同阴影效果的2D环状图。
# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>
相关链接:
ChartDirector是一种非常强大的图表控件,拥有丰富的图表图形库,今天来来看看如何在ChartDirector创建出不同阴影效果的2D环状图,如下所示:
所用的源代码如下:
ASP:
<%@ language="vbscript" %> <% Set cd = CreateObject("ChartDirector.API") ' The data for the pie chart data = Array(18, 30, 20, 15) ' The colors to use for the sectors colors = Array(&H66aaee, &Heebb22, &Hbbbbbb, &H8844ff) ' Create a PieChart object of size 200 x 220 pixels. Use a vertical gradient color ' from blue (0000cc) to deep blue (000044) as background. Use rounded corners of 16 ' pixels radius. Set c = cd.PieChart(200, 220) Call c.setBackground(c.linearGradientColor(0, 0, 0, c.getHeight(), &H0000cc, _ &H000044)) Call c.setRoundedFrame(&Hffffff, 16) ' Set donut center at (100, 120), and outer/inner radii as 80/40 pixels Call c.setDonutSize(100, 120, 80, 40) ' Set the pie data Call c.setData(data) ' Set the sector colors Call c.setColors2(cd.DataColor, colors) ' Demonstrates various shading modes If Request("img") = "0" Then Call c.addTitle("Default Shading", "bold", 12, &Hffffff) ElseIf Request("img") = "1" Then Call c.addTitle("Local Gradient", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.LocalGradientShading) ElseIf Request("img") = "2" Then Call c.addTitle("Global Gradient", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.GlobalGradientShading) ElseIf Request("img") = "3" Then Call c.addTitle("Concave Shading", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.ConcaveShading) ElseIf Request("img") = "4" Then Call c.addTitle("Rounded Edge", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.RoundedEdgeShading) ElseIf Request("img") = "5" Then Call c.addTitle("Radial Gradient", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.RadialShading) ElseIf Request("img") = "6" Then Call c.addTitle("Ring Shading", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.RingShading) End If ' Disable the sector labels by setting the color to Transparent Call c.setLabelStyle("", 8, cd.Transparent) ' Output the chart Response.ContentType = "image/png" Response.BinaryWrite c.makeChart2(cd.PNG) Response.End %>
VB:
Public Sub createChart(viewer As Object, img As String) Dim cd As New ChartDirector.API ' The data for the pie chart Dim data() data = Array(18, 30, 20, 15) ' The labels for the pie chart Dim labels() labels = Array("Labor", "Licenses", "Facilities", "Production") ' The colors to use for the sectors Dim colors() colors = Array(&H66aaee, &Heebb22, &Hbbbbbb, &H8844ff) ' Create a PieChart object of size 200 x 220 pixels. Use a vertical gradient ' color from blue (0000cc) to deep blue (000044) as background. Use rounded ' corners of 16 pixels radius. Dim c As PieChart Set c = cd.PieChart(200, 220) Call c.setBackground(c.linearGradientColor(0, 0, 0, c.getHeight(), &H0000cc, _ &H000044)) Call c.setRoundedFrame(&Hffffff, 16) ' Set donut center at (100, 120), and outer/inner radii as 80/40 pixels Call c.setDonutSize(100, 120, 80, 40) ' Set the pie data Call c.setData(data, labels) ' Set the sector colors Call c.setColors2(cd.DataColor, colors) ' Demonstrates various shading modes If img = "0" Then Call c.addTitle("Default Shading", "bold", 12, &Hffffff) ElseIf img = "1" Then Call c.addTitle("Local Gradient", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.LocalGradientShading) ElseIf img = "2" Then Call c.addTitle("Global Gradient", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.GlobalGradientShading) ElseIf img = "3" Then Call c.addTitle("Concave Shading", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.ConcaveShading) ElseIf img = "4" Then Call c.addTitle("Rounded Edge", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.RoundedEdgeShading) ElseIf img = "5" Then Call c.addTitle("Radial Gradient", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.RadialShading) ElseIf img = "6" Then Call c.addTitle("Ring Shading", "bold", 12, &Hffffff) Call c.setSectorStyle(cd.RingShading) End If ' Disable the sector labels by setting the color to Transparent Call c.setLabelStyle("", 8, cd.Transparent) ' Output the chart Set viewer.Picture = c.makePicture() 'include tool tip for the chart viewer.ImageMap = c.getHTMLImageMap("clickable", "", _ "title='{label}: US${value}K ({percent}%)'") End Sub
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@capbkgr.cn
文章转载自:慧都控件面对“数字中国”建设和中国制造2025战略实施的机遇期,中车信息公司紧跟时代的步伐,以“集约化、专业化、标准化、精益化、一体化、平台化”为工作目标,大力推进信息服务、工业软件等核心产品及业务的发展。在慧都3D解决方案的实施下,清软英泰建成了多模型来源的综合轻量化显示平台、实现文件不失真的百倍压缩比、针对模型中的大模型文件,在展示平台上进行流畅展示,提升工作效率,优化了使用体验。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@capbkgr.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢