- Ext.js 教程
- Ext.js - 首页
- Ext.js - 概述
- Ext.js - 环境设置
- Ext.js - 命名约定
- Ext.js - 架构
- Ext.js - 第一个程序
- Ext.js - 类系统
- Ext.js - 容器
- Ext.js - 布局
- Ext.js - 组件
- Ext.js - 拖放
- Ext.js - 主题
- Ext.js - 自定义事件和监听器
- Ext.js - 数据
- Ext.js - 字体
- Ext.js - 样式
- Ext.js - 绘图
- Ext.js - 本地化
- Ext.js - 无障碍
- Ext.js - 调试代码
- Ext.js - 方法
- Ext.js 的有用资源
- Ext.js - 问题与解答
- Ext.js - 快速指南
- Ext.js - 有用资源
- Ext.js - 讨论
Ext.js - 饼图
此图表用于以饼状图格式表示数据。这是一个极坐标图。
语法
下面是一个简单的语法。
Ext.create('Ext.chart.PolarChart', {
series: [{
Type: 'pie'
..
}]
render and other properties.
});
示例
下面是一个简单的示例,展示了饼图的使用方法。
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css"
rel = "stylesheet" />
<script type = "text/javascript"
src = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
<script type = "text/javascript"
src = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/packages/charts/classic/charts.js"></script>
<link href = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/packages/charts/classic/classic/resources/charts-all.css"
rel = "stylesheet" />
<script type = "text/javascript">
Ext.onReady(function() {
Ext.create('Ext.chart.PolarChart', {
renderTo: document.body,
width: 600,
height: 300,
store: {
fields: ['name', 'g1'],
data: [
{"name": "Item-0", "g1": 57},
{"name": "Item-1", "g1": 45},
{"name": "Item-2", "g1": 67}
]
},
//configure the legend.
legend: {
docked: 'bottom'
},
//describe the actual pie series.
series: [{
type: 'pie',
xField: 'g1',
label: {
field: 'name'
},
donut: 30 // increase or decrease for increasing or decreasing donut area in middle.
}]
});
});
</script>
</head>
<body>
</body>
</html>
上述程序将产生以下结果 −
extjs_components.htm
广告