ChartDirector 5.0 for python 笔记【4】Multi-Depth Pie Chart
来源:互联网 发布:gif调色软件 编辑:程序博客网 时间:2024/05/15 05:17
这篇是关于多深度饼图的。
先看源代码:
#-*-encoding:utf-8 -*-from pychartdir import *setLicenseCode("SXZVFNRN9MZ9L8LGA0E2B1BB");#这个是注册,防止有logo产生#数据data = [72, 18, 15, 12]#标签labels = ["Labor", "Machinery", "Facilities", "Computers"]#深度depths = [30, 20, 10, 10]# 新建一个PieChart对象,它为360 x 300像素大小,它的#背景颜色为0xddddff,带1个像素的3D效果边缘c = PieChart(360, 300, '0xddddff', -1, 1)#设置饼中心坐标和半径c.setPieSize(180, 175, 100)#添加一个标题栏,字体为15大小的timesbi,背景色0xaaaaffc.addTitle("Project Cost Breakdown", "timesbi.ttf", 15).setBackground('0xaaaaff')#设置数据和标签c.setData(data, labels)#根据给出的各个深度,画出图c.set3D2(depths)#设置起始角度225度。这是为了改善视觉效果,使得最厚的扇区在最后面。c.setStartAngle(225)#输出图表c.makeChart("multidepthpie.png")
下面看生成的饼图效果:
- ChartDirector 5.0 for python 笔记【4】Multi-Depth Pie Chart
- ChartDirector 5.0 for python 笔记【2】Simple Pie Chart
- ChartDirector 5.0 for python 笔记【3】3D Pie Chart
- ChartDirector 5.0 for python 笔记【9】Exploded Pie Chart
- ChartDirector 5.0 for python 笔记【11】Icon Pie Chart 上篇
- ChartDirector 5.0 for python 笔记【7】Pie Chart with Legend 上篇
- ChartDirector 5.0 for python 笔记【8】Pie Chart with Legend 下篇
- ChartDirector 5.0 for python 笔记【5】Side Label Layout
- ChartDirector 5.0 for python 笔记【6】Circular Label Layout
- ChartDirector 5.0 for python 笔记【0】目录概览
- ChartDirector 5.0 for python 笔记【1】环境介绍和搭建
- ChartDirector 5.0 for python 笔记【10】CDML 标记语言
- python中用matplotlib 画pie chart时避免标题重叠
- Shopping cart analysis with R(-1) – Multi-layer pie chart
- chart and pie
- flex3.0 chart pie
- dojo.Chart2D----Pie chart
- Pie Chart "Key"
- 关于如何解决silverlight安装错误:提示消息ID1603
- animation的xml定义中的android:interpolator属性
- MYSQL常用语法
- 送给入门新手----关于tableview 初级和高级
- 聊天气泡sms
- ChartDirector 5.0 for python 笔记【4】Multi-Depth Pie Chart
- SearchBar深度解析--这个比较早了 最近版sdk 有的方法不能用了 参考下吧
- OpenFlow(效果图)中文实用详解
- 简单号码分配器的实现分析
- Android Loop&Handle学习总结
- 改变键盘的颜色
- 黑马程序员_String类
- NSNavgationController自定义切换画面(传送参数)
- UItableView实现分页效果(点击more再显示10条)